Skip to main content
These rules apply across the whole schema. Each field’s description in the schema adds the details for that field.

Ids

Most objects have two kinds of id:
  • A global id in id. It is opaque; treat it as a string. Queries such as dataSourceById and arguments named like dataSourceId take it. For types that implement Node, such as DataSource and CardDefinition, node(id:) fetches the object by its global id.
  • A raw id, such as the source id products or an entry id SKU-123. The REST APIs use raw ids. In GraphQL, raw ids appear in fields like SourceEntry.entryId and SourceEntry.sourceId, and arguments like sourceEntries(sourceId:) take them.
The schema says which kind each field and argument expects. When a field description says “global id”, pass the id you read from the API, not the raw id.

Paging

Lists use cursor-based connections. Ask for a page with first and continue with after:
  • Read items from nodes, or from edges when you also need each item’s cursor.
  • When pageInfo.hasNextPage is true, pass pageInfo.endCursor as after to get the next page.
  • Keep the same filters and sort when you follow a cursor.
  • Each list sets its own default and maximum page size.
  • totalCount returns the number of matching items. On large lists, select it only when you need it.
Configuration lists such as dataSources and cardDefinitions also accept last and before to page backwards. Entry lists such as sourceEntries and cardEntries page forwards only.

Filtering

The API has two filter styles.

where and order on configuration lists

Lists of configuration, such as dataSources, cardDefinitions and folders, take a where object with one key per filterable field and an operator per key. Combine conditions with and and or. Sort with order.
Operators depend on the field type: for example eq, neq, in, contains and startsWith for text, and eq, gt, gte, lt and lte for dates.

Predicate and sort on entry lists

Entry lists, such as sourceEntries and cardEntries, filter on property values. Their where takes a Predicate. A predicate has exactly one branch, chosen by the property type: text, integer, decimal, boolean, timestamp, list or hasValue. Combine predicates with and, or and not.
  • Pass language when the filter or sort uses a localized property. There is no fallback language.
  • sort takes up to 16 keys. Use a property id, id, @createdAt or @updatedAt. Without sort, entries are sorted by entry id.
  • Card entry queries also support segment, relation and lifecycle predicates. Source entry queries reject them.

Mutations

Each mutation takes one input argument and returns a payload object. The payload has a field for the result, such as managedTagsList, and an errors list. Some objects carry an etag. When an update input asks for one, pass the etag you last read. If the object changed since then, the mutation fails with OptimisticConcurrencyError. Read it again and retry.

Errors

Errors come in two places. Expected mutation failures are returned in the payload’s errors list as GraphQlError objects. The result field is then null. A mutation’s description names any other code it can return. Request errors are returned in the standard GraphQL errors array of the response, for example a syntax error, a missing scope, or a missing token (AUTH_NOT_AUTHENTICATED). Fields that did resolve still return their data. A request that takes longer than 30 seconds ends with HTTP 504 and a JSON body with a requestId. Include the requestId when you contact support.