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

Content type
application/json
{
  • "query": "query accounts { uiapi { query { Account { edges { node { Name { value } } } } } } }"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "errors": [
    ],
  • "extensions": { }
}