Skip to Content
APIsGraphQLGraphQL queries

GraphQL queries

Deploy the tutorial schema and open Explorer’s Docs panel. Flexkit generates field names and input types from that schema; inspect the deployed schema when adding a field to an operation.

Read a small selection

For the tutorial Product entity, start with its system identifier and global SKU:

query TutorialProducts {
  products(limit: 10) {
    _id
    sku
  }
}

Local fields such as name are not necessarily scalar strings at the root of a record. Inspect their scope-shaped selection in Explorer. Relationship fields require nested selections too. See GraphQL reference.

Variables and filtering

Use the generated where input to narrow work to the intended records. Inspect the input fields in Explorer before adding a filter, sort, offset, or connection argument. Put values in the Variables panel as JSON rather than concatenating untrusted strings into a query.

Retrieve only the fields and page size needed. Follow the schema’s pagination controls until you have the required records; the first page is not a full export. Handle empty results and partial errors explicitly.

Read one tutorial product

The tutorial SKU is a unique global string. This operation uses a variable to select it and reads the default-scope name:

query ProductBySku($sku: String!) {
  products(where: { sku: { eq: $sku } }, limit: 1) {
    _id
    sku
    status
    name {
      default
    }
  }
}
{ "sku": "BAG-001" }

An empty products array means this request returned no matching accessible record. Compare it with the known saved record before concluding the data was deleted.

Verify the result

Compare _id and field values with a saved Desk record. If data differs, check project, scope, and permissions before changing the query. A successful response must still be checked for GraphQL errors.

Next: mutations and Explorer.

Last updated on

© 2026