The Summary of GraphQL
When you configure objects in Steedos, the GraphQL API is automatically generated for you.
Using the GraphQL API, you can ask for what you need and get exactly that. see GraphQL for more information.
About Data Permissions
Steedos supports many kinds of permissions configuration, such as Permission Set, Profile, Permission etc. You can use them to implement different permissions for different people to have access to different objects and fields, and what data can be returned, inserted, edited, deleted by the GraphQL API is controlled by these permission configurations.
To support permissions control, you should pass in a token
or userSession
on request that identifies the current user, see Authorize the GraphQL API for more information.
You can user the GraphQL API to Query, Insert, Edit and Delete the data that you have permissions to.
GraphQL Client Console
Suppose you have start a local service of Steedos with the port of 3000, then you can access the GraphQL client console with http://localhost:3000/graphql
.
In the GraphQL client console, you can input the GraphQL script in the left panel, and run it by clicking the run button on the top of the page.
Here are some examples that you can run directly on the client console.
A Basic Bxample
Ask for all accounts:
Note
You can also omit the first word that called query
as follows, which will have the same effect and return the same request results.
Get predictable results:
Infinitely extended query
You can extend the field indefinitely to query the relevant field value by define the field structure detail at the end of the object name and brackets.
The field structure detail is defined like bellow:
And it will return a data result like that:
See Query data by GraphQL API for more information.
Query data
You can query records by GraphQL API with filters
, fields
, top
, skip
and sort
, see Query data by GraphQL API for more information.
There is an example following: request all leads with status
attribute value of 'Qualified'.
Get predictable results:
Note
You can also replace the code filters:[["status", "=" "Qualified"]]
with filters:"status eq 'Qualified'"
which is a standard OData filtering string.