Query Syntax

Modified on Fri, 15 May at 11:50 AM

A GraphQL query has the following syntax:

query <operation name>[(<variables>)] {
  <object>[(<criteria>)] {
      <Field> [<Field>…]
  }
}

See below for a breakdown of the different fields:


<operation name> is a string identifying the query. This is “your name” for the query – you can put anything you like here.
<variables> Optional - Identifies any variables you are using in the query and their type. If you’re not using any variables in the query, then you can leave this blank. See Using Variables in GraphQL for more information.
<object>The object you want to query – if you’re using the IDE you can click on “Schema Reference” to get the list of objects that you can query. See Accessing the GraphQL API with a Browser for information on browsing the Schema Reference.
<criteria>  Optional - any criteria you want to apply to the query to restrict the results. The criteria will change depending on what is available on the specified <object> and can include paging information (take/skip), the order in which you want the results to be presented (order) as well as selection clauses to limit what is returned (where). The criteria is optional and without it, all the records for the specified object are returned.
<field>A list of one or more fields to return in the result set.


For more information on take/skip click here, or for more information on ordering click here.

 

If you have any further queries please get in touch with your account manager.  If you do not know who your account manager is, please submit a ticket using this link


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article