O
O
Oleg-Ukraine2017-08-18 14:19:30
API
Oleg-Ukraine, 2017-08-18 14:19:30

GraphQL concept of organizing arguments?

Hello everyone, I'm interested in the following question.
I have a GraphQL query like this.

product{
    slug
    title 
    price
    description
    productComments{
      text
      created
      updated
    }
  }

Requests for the field filter are carried out in the form of a regular json object . There are 2 task formats for which you need to complete the request for the front
product(price:{from:23, to:45}, categoryId:{is:4})
  1. 1. It is necessary to form a request for productComments, and build a selection of comments in the set of comments for the product
  2. 2. It is necessary to form a request for productComments, and build a selection of Products, depending on the data in the comments

Example 1. Select all products, add comments to them that have the status "moderated"
Example 2. Select all products in which user 1 left a comment.
What is the best way to describe this in a GraphQL query?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question