GraphQL Operations
Author:
Fluent Commerce
Changed on:
16 Oct 2024
Overview
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It provides a complete and easy-to-understand description of the data in your API. Its ability to return select fields enables it to be used with powerful developer tools and ensures that APIs are easily scalable.Fluent's GraphQL API has two operations:- Queries
- Mutations
Key points
- Operations
- Queries
- Mutations
- Custom Queries
Operations

Queries
Query operations are used for retrieving data. Fluent's GraphQL API has two types of query operations:- Get Operations
- Search Operations
Get Operations
Get operations always return a single result. These operations should be used when a unique identifier for the object to be retrieved is known. This can be an ID, ref (reference), or both in conjunction. In some cases, it can also be defined by something else. Refer to the GraphQL Queries page for more details.Examples
Search Operations
Search operations filter out objects of a given type. They should be used when searching for objects that meet one or more criteria. An example of such an operation would be to search for and get all Orders of type "HD." Search operations are also great for reporting on particular types.Example
Additional Information
To pass schema complexity validation, all GraphQL API operation queries must meet the following standards:- Search queries should be supplied with a first or last argument. The query will only return the first 10 records if these arguments are not provided.
- Values of first and last must be within 1 - 5,000. If the value exceeds 5000, it is replaced by 5000.
- Queries must have a complexity value of under 11,111, as those that exceed it will not be executed.