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:

query{
contacts {
name,
amount
}
}
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.

{
contacts {
name,
amount
}
}

Get predictable results:

{
"data": {
"accounts": [
{
"name": "Phase 2 Construction Contract",
"amount": 70000
},
{
"name": "2021 OA Project Maintenance Contract",
"amount": 89000
}
]
}
}

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:

query{
contracts {
name
amount
othercompany{
name
owner{
name
}
}
}
}

And it will return a data result like that:

{
"data": {
"contracts": [
{
"name": "Phase 2 Construction Contract",
"amount": 70000,
"othercompany": {
"name": "3M",
"owner": {
"name": "Litant"
}
}
},
{
"name": "2021 OA Project Maintenance Contract",
"amount": 89000
}
]
}
}

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'.

query{
leads(filters:[["status", "=", "Qualified"]], top:1, sort:"name desc"){
name,
title,
status
}
}

Get predictable results:

{
"data": {
"leads": [
{
"name": "Lead A",
"title": "GM",
"status": "Qualified"
}
]
}
}
Note

You can also replace the code filters:[["status", "=" "Qualified"]] with filters:"status eq 'Qualified'" which is a standard OData filtering string.

Have questions about Steedos??
Contact Steedos and our technical expert will answer your questions.

Our technical experts have more than 10 years of experience in management software development, and they are always ready to help you with any questions you may have about the functionality, pricing, implementation or any other aspect of Steedos.

Steedos

Steedos is a new generation of low code platform, based on business intelligence and model driven, it can easily and easily create intelligent, mobile and personalized applications according to the needs of business departments.

Copyright © 2020 Steedos, Inc.