---
schema_version: "1"
id: 6762c78536d8827cd0ed014580496981e9af9de5b14669f4c8268249bd064739
title: Understand GraphQL Schema Requirements
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/graphql_requirements.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.graphql_requirements.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 25db230d424a81982373bf35c891407d9b93366e61e37cdb4bf733de93d009eb
description: The Salesforce Connect adapter for GraphQL requires that the GraphQL schema adhere to a specific format.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Understand GraphQL Schema Requirements

The Salesforce Connect adapter for GraphQL requires that the GraphQL schema adhere to a specific format.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
      <colgroup>
        <col>
      </colgroup>
      <tbody>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience (not for high-data-volume
            external objects)</td>

        </tr>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <p>Available in: <strong>Developer</strong> Edition</p>
            <p style="margin-bottom:0;">Available for an extra cost
              in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong>
              Editions</p>
          </td>

        </tr>
      </tbody>
    </table>

This is a representative schema to understand how to construct a schema that works with Salesforce Connect. Notations to understand the representative schema:

- ObjName: Denotes the name of a GraphQL object.
- Bold text: Represents the pattern to follow for each object.
- Non-bold text: Represents common code, not specific to the objects.

`type Query {     **objName(         limit: Int,         offset: Int,         orderBy: [ObjName_OrderByInput],         where: ObjName_FilterInput,         first: Int,         after: String     ): ObjName_Connection**         <additional object queries...>         node(id: ID!): Node }  type Mutation {    ** create_ObjName(input: ObjName_CreateInput!): ObjName**     <additional create mutations>     ...    ** delete_ObjName(id: ID!): ObjName**     <additional delete mutations>     ...     **update_ObjName(input: ObjName_UpdateInput!): ObjName**     <additional update mutations>     ... }  **type ObjName implements Node {     id: ID!     <fieldName: fieldType>     ... }  type ObjName_Connection {     edges: [ObjName_Edge]     pageInfo: PageInfo! }  input ObjName_CreateInput {         <fieldName: fieldType>         ... }  input ObjName_UpdateInput {     id: ID!     <fieldName: fieldType>     ... }  type ObjName_Edge {     cursor: String!     node: ObjName }  input ObjName_FilterInput {     and: [ObjName_FilterInput]     not: ObjName_FilterInput     or: [ObjName_FilterInput]     id: IDOperator     <fieldName: fieldTypeOperator>     ... }  input ObjName_OrderByInput {     id: OrderByClause     <fieldName >: OrderByClause     ... }**  interface Node {     id: ID! }  enum NullsOrder {     NULLS_FIRST     NULLS_LAST }  input OrderByClause {     direction: Direction     nulls: NullsOrder }  type PageInfo {     endCursor: String     hasNextPage: Boolean!     hasPreviousPage: Boolean!     startCursor: String }  input StringOperator {     eq: String     gt: String     ge: String     in: [String]     like: String     lt: String     le: String     ne: String     nin: [String] }  input AWSDateOperator {     eq: AWSDate     gt: AWSDate     ge: AWSDate     in: [AWSDate]     like: AWSDate     lt: AWSDate     le: AWSDate     ne: AWSDate     nin: [AWSDate] }  input AWSDateTimeOperator {     eq: AWSDateTime     gt: AWSDateTime     ge: AWSDateTime     in: [AWSDateTime]     like: AWSDateTime     lt: AWSDateTime     le: AWSDateTime     ne: AWSDateTime     nin: [AWSDateTime] }  input AWSJSONOperator {     eq: AWSJSON     gt: AWSJSON     ge: AWSJSON     in: [AWSJSON]     like: AWSJSON     lt: AWSJSON     le: AWSJSON     ne: AWSJSON     nin: [AWSJSON] }  input AWSTimeOperator {     eq: AWSTime     gt: AWSTime     ge: AWSTime     in: [AWSTime]     like: AWSTime     lt: AWSTime     le: AWSTime     ne: AWSTime     nin: [AWSTime] }  input BooleanOperator {     eq: Boolean     gt: Boolean     gebolded: Boolean     in: [Boolean]     like: Boolean     lt: Boolean     le: Boolean     ne: Boolean     nin: [Boolean] }  enum Direction {     ASC     DESC }  input FloatOperator {     eq: Float     gt: Float     ge: Float     in: [Float]     like: Float     lt: Float     le: Float     ne: Float     nin: [Float] }  input IDOperator {     eq: ID     gt: ID     ge: ID     in: [ID]     like: ID     lt: ID     le: ID     ne: ID     nin: [ID] }  input IntOperator {     eq: Int     gt: Int     ge: Int     in: [Int]     like: Int     lt: Int     le: Int     ne: Int     nin: [Int] }`

Each object must have an `ID!` field that’s globally unique and this global ID must be same across all the objects. If you have multiple fields of type `ID!` and there isn’t field with id as the field name, use `keyColumns` qualifier to specify the global ID. See [Qualifier Options](https://help.salesforce.com/s/articleView?id=platform.graphql_qualifiers_options.htm&release=264.0.0&type=5 "We recommend you use the default global id in the GraphQL schema to construct the external ID of an external object.").

When an external lookup relationship represents the same lookup relationship that exists between GraphQL objects, keep in mind these considerations. The external ID field on the parent external object must match the format of the external lookup field of the child external object. In case they don’t match, use qualifiers to manage one of the following:

- Manipulate the parent external object’s external ID to match the child external lookup.
- Create a virtual column in the child external object to match the parent external ID.

It’s important that the GraphQL global ID and Salesforce external ID can be computed from one another. A possible way to structure a global ID is to use a prefix to namespace the ID and keep it unique. If the primary key of the object is composed of multiple key fields, use a delimiter to separate the prefix and the ID. If any of the key fields’ value contains the delimiter, make sure to escape the delimiter.

In this example, `ObjName|` is the prefix and `-` is the delimiter. Using `|` after the `ObjName` helps to parse the prefix from the key composition.

```
id: ObjName|KEY1\-123-KEY2\-456
key1: KEY1-123
key2: KEY2-456
```

#### See Also

- [_GraphQL_: Schemas and Types](https://graphql.org/learn/schema/)
- [Salesforce Connect Adapter for GraphQL](https://help.salesforce.com/s/articleView?id=platform.graphql_adapter_about.htm&release=264.0.0&type=5 "GraphQL is a standard query language that allows applications to flexibly access required data and provides a modern way to integrate applications. Unlike traditional REST APIs, GraphQL provides granularity in specifying fields and relationships and is more efficient.")