Ids
Most objects have two kinds of id:- A global id in
id. It is opaque; treat it as a string. Queries such asdataSourceByIdand arguments named likedataSourceIdtake it. For types that implementNode, such asDataSourceandCardDefinition,node(id:)fetches the object by its global id. - A raw id, such as the source id
productsor an entry idSKU-123. The REST APIs use raw ids. In GraphQL, raw ids appear in fields likeSourceEntry.entryIdandSourceEntry.sourceId, and arguments likesourceEntries(sourceId:)take them.
id you read from the API, not the raw id.
Paging
Lists use cursor-based connections. Ask for a page withfirst and continue with after:
- Read items from
nodes, or fromedgeswhen you also need each item’scursor. - When
pageInfo.hasNextPageistrue, passpageInfo.endCursorasafterto 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.
totalCountreturns the number of matching items. On large lists, select it only when you need it.
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.
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
languagewhen the filter or sort uses a localized property. There is no fallback language. sorttakes up to 16 keys. Use a property id,id,@createdAtor@updatedAt. Withoutsort, entries are sorted by entry id.- Card entry queries also support
segment,relationandlifecyclepredicates. Source entry queries reject them.
Mutations
Each mutation takes oneinput 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’serrors 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.