When should you use GraphQL?
Use GraphQL to read several related records in one request. For example, you can get a receiving, its lines, and the article for each line in the same request. For most integrations and for data changes, use the REST API. GraphQL is intended for advanced read operations. One exception lets you attach a document to a record.Principles
- One URL: Send all requests with
POSTto the GraphQL URL for your space. - A targeted response: List the fields that you want to receive.
- An inspectable schema: Compatible tools can read the schema and suggest available fields, including your custom fields.
Authentication
Each request must contain an API token in thex-api-key header. See
Authentication to create this token.
The GraphQL URL for your space is provided with the token. The examples use the
$BONX_GRAPHQL_URL and $BONX_API_KEY variables.
Request structure
Send a JSON object with aquery key. Add a variables key if the query uses
dynamic values.
query string.
Operation names
The token permissions determine the available operations. Each change made with
a token appears in the record history and is attributed to that token.
Continue to the Quickstart to send your first request.