Operations

There are two operations that can be performed on data through the GraphQL API: queries and mutations.

A query operation returns a list of data based on the criteria of the query.

Diagram shows the query operation

There are four types of queries that are possible. All queries take as input cursor details, which indicate how many items to return in the query and/or after which cursor (pointer) to start the list for pagination. They also take an advanced filter, which is a compound predicate for specifying type matching criteria. Event queries (three of them) act against the event data warehouse and also take as input details from Business Events Details, which include common parameters such as timestamps around when the event(s) occurred. The fourth query is for the Business Objects themselves, operating against the object data warehouse.

Error events
Returns a list of error events based on error event details, which specifies the type of error to query: ingestion or processing.
Business Object events
Returns a list of business object events based on detail input from events affecting business objects.
Business Rule events
Returns a list of business rule events based on detail input from events stemming from the firing of a rule.
Business objects
Returns a list of business objects based on business object identification information as well as the name of a serialized view which is used behind the scenes to perform the query.

Mutations

Mutations are how data is modified (created or updated). Mutations are always captured as an event. In other words, it is not possible to modify a business object outside an event, so the input to a mutation is expressed as event details. Also note that it isn't possible to delete a business object.

Diagram of mutation

The event details has three primary attributes:

Business object
These are the object details being upserted. If it points to an existing business object, then that business object is updated using the details in this event. Otherwise, a new business object is created.
Remove
Optionally, for business objects that support lines (e.g. order lines, shipment lines, etc) this attribute lists what lines should be removed from the business object.
Replace
Optionally, for business objects that support lines (e.g. order lines, shipment lines, etc) this attribute lists a new set of lines that should replace all existing lines in the business object. All mutations also include an event source attribute which details nature of the source from which this event originates. For example, it lists the EDI 850 order document details if this is an Order upsert event.