---
schema_version: "1"
id: 2df97a6de738aaf5c66124702b854cd2b9acfb66b1833911126d996e7cd9ee6f
title: Schema Conventions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/guides/schema-conventions.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/guide/schema-conventions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 96774efbe43da80012b7795eb99b47ab4b55a8af9f49c1534a58f9db1a0158f4
products:
  - GraphQL API
---
# Schema Conventions

Within the Salesforce GraphQL schema, there are several conventions that the types adopt to make sure that the schema performs as expected for your record data. Fundamentally, GraphQL API defines types that describe the set of data you can query from the UI API family. It also provides pagination, error querying, and versioning support.

## Operation Types

Several operation types are available with GraphQL API.

```
schema {
    query: Query
    mutation: Mutation
}
```

- `Query`- Provides an entry point for read operations.
- `Mutation`- Provides an entry point for create, update, and delete operations. `Mutation` is available as a Beta Service in API v59.0–65.0 and is generally available in API v66.0 and later.

## API Families

Each API family has a top-level field on the `Query` operation type, which serves as the entry point to that API family. The `Query` operation type has a `uiapi` field, a `managed_content` field, and a `rateLimit` field. The `rateLimit` field is deprecated.

```
type Query {
  uiapi: UIAPI!
  managed_content: ManagedContent__ManagedContent!
  rateLimit: RateLimit
}
```

The [`Mutation` operation type](https://developer.salesforce.com/docs/platform/graphql/guide/mutations/mutations-intro.md) has a `uiapi` field with a `UIAPIMutationsInput` argument. The `UIAPIMutationsInput` has a boolean argument `allOrNone` that has a default value of `true`. When `true`, if one or more operations fails, all operations are rolled back and not executed.

```
type Mutation {
  uiapi(input: UIAPIMutationsInput): UIAPIMutations!
}

input UIAPIMutationsInput {
  allOrNone: Boolean
}
```

## UI API Family

Access the User Interface API (UI API) family via the `uiapi` field of type `UIAPI`.

```
```

**tip:** UI API enables developers to build user interfaces so that users can work with records, list views, actions, favorites, and so on. It’s the API that powers Lightning Experience, Salesforce for Android, iOS, and mobile web. See the [UI API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/).

### UIAPI Type

The `UIAPI` type includes these fields.

```
type UIAPI {
  query: RecordQuery!
  aggregate: RecordQueryAggregate!
  objectInfos(apiNames, locale, objectInfoInputs): [ObjectInfo]
  relatedListByName(parentApiName, relatedListName): RelatedListInfo
  currentUser: RecordRepresentation
  recordLayouts(objectApiName: String!, recordTypeIds: [ID!], layoutConfigs: [LayoutConfig!], layoutType = "FULL": LayoutType, formFactor = "LARGE": FormFactor, mode = "VIEW": LayoutMode, first: Int, after: String): LayoutConnection
  recordCreateDefaults(objectApiName: String!, recordTypeIds: [ID!], formFactor = "LARGE": FormFactor, mode = "LAYOUT": CreateDefaultsMode, configs: [CreateDefaultsConfig!], optionalFields: [String!], first: Int, after: String): CreateDefaultsConnection
  lookupValues(objectApiName: String!, fieldApiName: String!, q: String, searchType: LookupSearchType, targetApiName: String, sourceRecord: RecordSnapshotInput): [LookupValues!]
  platform: Platform!
}
```

Use the `UIAPI` type to:

- [Query records](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-record-objects.md)
- [Aggregate queries](https://developer.salesforce.com/docs/platform/graphql/guide/aggregate/aggregate.md)
- [Get object metadata](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-objectinfo.md)
- [Get related list metadata](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-related-list-info.md)
- [Get the current user’s User record](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-current-user-record.md)
- [Get object layouts](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-record-layouts.md)
- [Get record create defaults](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-record-create-defaults.md)
- [Get lookup values](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-lookup-values.md)
- [Use platform capabilities](https://developer.salesforce.com/docs/platform/graphql/guide/query/platform.md)

## Managed Content Family

Use the Managed Content family to search and retrieve Salesforce CMS content. Access the Managed Content API family via the `managed_content` field of type `ManagedContent__ManagedContent`. The Managed Content API family is available in v67.0 and later. See [Managed Content GraphQL API Family](https://developer.salesforce.com/docs/platform/cms/guide/managed-content-intro.html) in the _CMS Developer Guide_ for use cases and examples.

## Pagination

The GraphQL server adopts the [Relay Connection Specification](https://relay.dev/graphql/connections.htm) for pagination. [Pagination](https://graphql.org/learn/pagination/) is a common way for a GraphQL server to structure types when dealing with a result set that requires iteration. See [Paginate Results](https://developer.salesforce.com/docs/platform/graphql/guide/paginate.md).

## Query Errors

When reading data via the `Query` type, if an error occurs accessing a field, then the [Errors](https://developer.salesforce.com/docs/platform/graphql/guide/requests-and-responses.md#response) list of the response includes the error. The error contains a path that associates the error with the originally requested field. See [Status Codes and Errors Responses](https://developer.salesforce.com/docs/platform/graphql/guide/query/query-status.md).

## Versioning

While most GraphQL servers don’t include a version in the URL to the GraphQL endpoint, the Salesforce GraphQL schema does. Various types of objects, such as sObjects, depend on the version for their construction. These objects require some version of the API to bind the request to. All new types and fields added to the Salesforce platform have an associated version. The API version dictates what capabilities the application server has when processing the request. For this reason, the GraphQL endpoint includes a version, which is the version of the API used during the request.
