Running examples
Last updated
Was this helpful?
Last updated
Was this helpful?
The examples documented here can be run using:
.
The command line.
You can run GraphQL queries in a curl
request on the command line on your local machine. A GraphQL request can be made as a POST
request to https://api.kublau.com/graphql
with the query as the payload. You can authorize your request by using a to use as a bearer token.
Example:
The Kublau GraphQL API can be used to perform:
Queries for data retrieval.
for creating, updating, and deleting data.
Note: In the API, id
refers to a global ID, which is an object identifier in the format of gid://kublau/ObjectType/xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
outlines which objects and fields are available for clients to query and their corresponding data types.
Example: Return a Workspace resource corresponding to the API Key used in request.
Mutations make changes to data. We can update, delete, or create new records. Mutations generally use InputTypes and variables, neither of which appear here.
Mutations have:
Inputs. For example, arguments, such as which carrier you’d like to use when creating a shipment.
Return statements. That is, what you’d like to get back when it’s successful.
User errors. Always ask for what went wrong, just in case.
Creation mutations
Example: Let’s create a shipment Tracker.
Example: Get all the type names in the schema.
Example: Get all the fields associated with Tracker. kind
tells us the enum value for the type, like OBJECT
, SCALAR
or INTERFACE
.
More about mutations: .
Clients can query the GraphQL endpoint for information about its own schema. by making an .
It is through an introspection query that the gets all of its knowledge about our GraphQL schema to do autocompletion and provide its interactive Docs
tab.
More about introspection: