How do I show product ratings and customer reviews on the front end per product item


#1

Hi guys,
I am new to development and I have been struggling with this problem for weeks.

Is there anyway anyone can help me figure out how to display a list customer product ratings per one product Item on the front end from the database?

I am able to display the product ratings but not able filter them per product page on the front end. I have already solved the relationship connection on the back end.

Keep getting this error message:
[GraphQL error]: Message: Unknown argument “currentItem” on field “createRating” of type “Mutation”., Location: [object Object], Path: undefined
index.js:81 [GraphQL error]: Message: Variable “$title” is not defined by operation “CREATE_RATING_MUTATION”., Location: [object Object],[object Object], Path: undefined
index.js:81 [GraphQL error]: Message: Variable “$description” is not defined by operation “CREATE_RATING_MUTATION”., Location: [object Object],[object Object], Path: undefined
index.js:81 [GraphQL error]: Message: Variable “$price” is not defined by operation “CREATE_RATING_MUTATION”., Location: [object Object],[object Object], Path: undefined
index.js:81 [GraphQL error]: Message: Variable “$image” is not defined by operation “CREATE_RATING_MUTATION”., Location: [object Object],[object Object], Path: undefined
index.js:81 [GraphQL error]: Message: Variable “$largeImage” is not defined by operation “CREATE_RATING_MUTATION”., Location: [object Object],[object Object], Path: undefined

CreateRating.js

Mutation.js

Query.js

Datamodel.prisma:
You can see my relations between Item and Rating

schema.graphql:

CreateItem.js


#2

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.