GraphQL API (66.0)
Download OpenAPI specification:Download
GraphQL API provides a single endpoint that returns exactly what you request for. You can introspect the schema to define your request with the data you need. The schema contains concrete representations of Salesforce objects, following the object-level and field-level security settings of the context user.
To learn how to authenticate and authorize requests, see Authorization.
To learn what's new with GraphQL API and see versioned reference changes, see Release Notes.
Send Query
Execute a GraphQL query.
Before you can send a GraphQL API query, make sure you set up authorization by following a Quick Start. You need an API access token to authenticate your requests via a client like Altair or Postman. For example requests, see the Postman Collection.
Request Body schema: application/json
object The extensions to the input. | |
| operationName | string The operation that’s being executed. |
| query required | string The GraphQL query. |
object The variables for the query. |
Responses
Request samples
- Payload
{- "query": "query accounts { uiapi { query { Account { edges { node { Name { value } } } } } } }"
}Response samples
- 200
{- "data": {
- "uiapi": {
- "query": {
- "Account": {
- "edges": [
- {
- "node": {
- "Id": "0011a000005slmbAAA",
- "Name": {
- "value": "GenePoint"
}
}
}, - {
- "node": {
- "Id": "0011a000005slmcAAA",
- "Name": {
- "value": "United Oil & Gas, UK"
}
}
}, - {
- "node": {
- "Id": "0011a000005slmeAAA",
- "Name": {
- "value": "Edge Communications"
}
}
}
]
}
}
}
}, - "errors": [
- {
- "extensions": {
- "ErrorType": "ValidationError"
}, - "locations": [
- {
- "column": 7,
- "line": 4
}
], - "message": "Validation error of type FieldUndefined: Field 'Accounts' in type 'RecordQuery' is undefined @ 'uiapi/query/Accounts'",
- "paths": [
- "uiapi",
- "query",
- "Account",
- "edges",
- 4,
- "node"
]
}
], - "extensions": { }
}