---
schema_version: "1"
id: e41dfd9b6d2038efc416594f0fed412f94fb552c58e8e6d3d60a438698b734cc
title: GraphQL API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/references/generated-api-specs/graphql.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/references/graphql
source_site: developer.salesforce.com
content_type: documentation
content_hash: 987627c4010a5eae332bfffc5f7dd32f9896c8bc4c2d9a942f1ed40829547027
products:
  - GraphQL API
---
GraphQL API

# GraphQL API

GraphQL API provides a single endpoint that returns exactly what you request for. You can [introspect the schema](/docs/platform/graphql/guide/get-started.html) 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](/docs/platform/graphql/guide/authorization.html).

To learn what's new with GraphQL API and see versioned reference changes, see [Release Notes](/docs/platform/graphql/guide/graphql-release-notes.html).

**Version:** 68.0

## Servers

*   `https://{MyDomainName}.my.salesforce.com/services/data/v68.0` The production API server. The `{MyDomainName}` variable is your org's My Domain name, which is used as a subdomain for the URLs that Salesforce uses to serve your org. For example, if your Lightning URL is `https://yourcompanyname.lightning.force.com`, then your My Domain name is `yourcompanyname`. Find your My Domain name and login URL on the My Domain page in Setup, or use the `getMyDomainName()` method in the Apex Domain class.

## Operations

### POST Send Query

`POST /graphql`

Operation ID: `sendQuery`.

Returns the result of a GraphQL query.

Execute a GraphQL query.

Before you can send a GraphQL API query, make sure you set up authorization by following a [Quick Start](/docs/platform/graphql/guide/get-started.html). You need an API access token to authenticate your requests via a client like Altair or Postman. For example requests, see the [Postman Collection](https://www.postman.com/salesforce-developers/workspace/salesforce-developers/folder/12721794-23e285e8-51bd-438a-a130-847f1e3e6d7b?ctx=documentation).

#### Request body

Media type: `application/json`. Schema: `GraphQLInputRepresentation`.

_Example_

```
{
  "query": "query accounts { uiapi { query { Account { edges { node { Name { value } } } } } } }"
}
```

#### Responses

*   **200** Success
    
    Media type: `application/json`. Schema: `GraphQLRepresentation`.
    
    _Example_
    
    ```
    {
      "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": {}
    }
    ```
    

## Schemas

### GraphQLInputRepresentation

A GraphQL query and any associated variables.

*   `extensions` (_object_) The extensions to the input.
    
    Additional properties: `object`.
    
*   `operationName` (_string_) The operation that’s being executed.
*   `query` (_string_, required) The GraphQL query.
*   `variables` (_object_) The variables for the query.
    
    Additional properties: `object`.
    

### GraphQLRepresentation

GraphQL query result.

*   `data` (_object_) The data of the GraphQL query result.
    
    Additional properties: `object`.
    
*   `errors` (_array of GraphQLErrorRepresentation_) The errors that resulted from this query.
*   `extensions` (_object_) The extensions that resulted from this query.
    
    Additional properties: `object`.
    

### GraphQLErrorRepresentation

A GraphQL Error.

*   `extensions` (_object_) Information about the error. See [Status Codes and Error Responses](/docs/platform/graphql/guide/query-status.html).
    
    Additional properties: `object`.
    
*   `locations` (_array of GraphQLErrorLocation_) The locations where the error occurred.
*   `message` (_string_) The reason the error occurred.
*   `paths` (_array of any_) The paths where the error occurred. Each item in the paths array can either be a string or an integer. As the path is a reference to the resolved data, the path may contain integers when the error occurs within a list.

### GraphQLErrorLocation

The location where a GraphQL error occurred.

*   `column` (_integer_) The column number where the GraphQL error occurred.
*   `line` (_integer_) The line number where the GraphQL error occurred.