In GraphQL, the query is specified as follows: GraphQL query for listing catalog items - example query q { catalogltems(versionSelector: {draftVersion: true}) { edges { node { gid draftVersion { name

Root item: Each query begins with a root item starting from which nodes are retrieved (root item: catalogltems). Fields: Queries look for information contained in fields; objects have a number of fields that can be used to filter query results. Arguments: It is possible to narrow down the query results through arguments, which define additional features of the object.(Argument: draftVersion is supplied for the field versionselector. Since the requested value of the argument is true, the query is expected to return catalog items that are in draft or published state). Edges: A technical wrapper that allows you to fetch more information, such as totalCount, and customize other fields related to pagination. This way, you can specify how many nodes the query returns. Node: Nodes are queried items(the query searches for two fields on each node, gid and name).

The request is provided as query property in JSON format in the request body. Additional fields include operationName and variables, which are optional. operationName should be used when working with multiple operations simultaneously. E.g. Request body for listing catalog items: “operationName”: “q” “variables”: “query”: “query q {catalogltems(versionselector: {draftversion: true}) {edges {node {gid draftVersion { name }}}}}”

Operation name and type The operation name should be a meaningful name assigned to each request. If you are sending only one query at a time, using an operation name is not necessary. When making multiple queries at once, operation names are very helpful for interpreting results and debugging any issues. A GraphQL operation can be one of the three types: Query: A read-only fetch operation which returns data without making any changes. Mutation: Generally used when modifying data or starting processes. e.g. insert, update or delete operation. Subscription: Refers to the real-time or continuous consumption of events, facilitating the seamless integration of real-time functionality into your applications, while ensuring that only the necessary data is returned from live events. The operation type is declared at the beginning Of the query. GraphQL operation name example: query operationName {

Variables If you are using variables, these need to be declared after the operation name while the value is provided in the variables property in the request body. Values that cannot be empty are marked by an exclamation mark following the variable type (!). In the query itself, the variable is passed as an argument using the syntax <variable_name>. In variables, you need to reference the variable name without any prefixes and supply its value. In the following example, the gid variable is declared as a non-null globally unique identifier type (GID). "operationName": "q", "variables": { "gid": "0726c74e-fc9e-40ad-a29d-23ecldac8769" "query": "query q(gid: GID!) {catalogltem(gid: $gid) { … }}” If you are using GraphQL Playground, variables are declared in the Query Variables section using, for example, the following syntax:

Requests sent to a GraphQL endpoint return the HTTP 200 0K response. The standard error handling mechanism for GraphQL Requests involves analysing the response body containing an errors object. • The errors key contains an array of errors returned by the server, with a message and location. If you attempt to publish an entity that no longer exists, the “node not found” message is returned. If you attempt to send a request without having authority, an informative error message e.g. “invalid _ grant” is expected. When there is an issue with authentication, you can find more details in error _ description in the message field.