GraphQL Admin API Reference

GraphQL Admin API Reference

Queries

client

Description

A client.

Response

Returns a Client

Example

Query
query client {
  client {
    scopes {
      ...ScopeConnectionFragment
    }
  }
}
Response
{"data": {"client": {"scopes": ScopeConnection}}}

store

Description

A store.

Response

Returns a Store!

Example

Query
query store {
  store {
    account {
      ...AccountFragment
    }
    appExtensions {
      ...AppExtensionsConnectionFragment
    }
    id
    settings {
      ...StoreSettingsFragment
    }
    storeHash
    storeReferenceId
  }
}
Response
{
  "data": {
    "store": {
      "account": Account,
      "appExtensions": AppExtensionsConnection,
      "id": 4,
      "settings": StoreSettings,
      "storeHash": "abc123",
      "storeReferenceId": "xyz789"
    }
  }
}

system

Description

System information.

Response

Returns a System!

Example

Query
query system {
  system {
    time
  }
}
Response
{"data": {"system": {"time": {}}}}

Mutations

appExtension

Description

App Extension mutations.

Response

Returns an AppExtensionMutations!

Example

Query
mutation appExtension {
  appExtension {
    createAppExtension {
      ...CreateAppExtensionResultFragment
    }
    updateAppExtension {
      ...UpdateAppExtensionResultFragment
    }
    deleteAppExtension {
      ...DeleteAppExtensionResultFragment
    }
  }
}
Response
{
  "data": {
    "appExtension": {
      "createAppExtension": CreateAppExtensionResult,
      "updateAppExtension": UpdateAppExtensionResult,
      "deleteAppExtension": DeleteAppExtensionResult
    }
  }
}

settings

Description

Store settings mutations.

Response

Returns a StoreSettingsMutations

Example

Query
mutation settings {
  settings {
    dataSolutions {
      ...DataSolutionsMutationsFragment
    }
  }
}
Response
{
  "data": {
    "settings": {"dataSolutions": DataSolutionsMutations}
  }
}

Types

Account

Description

An account.

Fields
Field Name Description
id - ID! The ID of the object.
Example
{"id": "4"}

AppExtension

Description

The response object for any query or mutation that returns an App Extension.

Fields
Field Name Description
id - ID! The ID of the object.
context - AppExtensionContext Defines the action that the control panel performs after the user clicks the App Extension label.
label - AppExtensionLabel! The locale-aware options for the App Extension menu item link text.
model - AppExtensionModel The entity type to which the App Extension relates; for example, Orders.
url - String! A relative path with some meaning to your app, most commonly an internally-defined GET route. The path should contain a supported path parameter that the app expects to be templated into its route, defined as a JavaScript string template literal. For example, '/customer/auth/${id}'. Currently, id is the only supported parameter. Limit 255 characters.
Example
{
  "id": "4",
  "context": "LINK",
  "label": AppExtensionLabel,
  "model": "CUSTOMERS",
  "url": "abc123"
}

AppExtensionContext

Description

Defines the action that the control panel performs after the user clicks the App Extension label.

Values
Enum Value Description

LINK

The control panel navigates the user away from their current page to the parent app's page, where the app can render App Extension-specific content.

PANEL

The control panel opens a side panel on the user's current page, where the app can render content without navigating away.
Example
"LINK"

AppExtensionLabel

Description

An object that contains locale-aware link text for the App Extension URL. The control panel user sees this link text wherever they have the option to open the App Extension.

Fields
Field Name Description
defaultValue - String! The link text that the user sees when the control panel language is English or a language for which the developer has not defined a label in label.locales. The defaultValue should be in English. Suggested length of ≤25 characters; limit 255 characters.
locales - [AppExtensionLabelLocale!]! The list of locale-aware link text options for an App Extension, excluding the defaultValue.
Example
{
  "defaultValue": "abc123",
  "locales": [AppExtensionLabelLocale]
}

AppExtensionLabelInput

Description

The label of the App Extension.

Fields
Input Field Description
defaultValue - String! The link text that the user sees when the control panel language is English or not defined by the developer in label.locales. The defaultValue should be in English. Suggested length of ≤25 characters; limit 255 characters.
locales - [AppExtensionLabelLocaleInput!]! A list of alternate link text values and their corresponding locale codes.
Example
{
  "defaultValue": "abc123",
  "locales": [AppExtensionLabelLocaleInput]
}

AppExtensionLabelLocale

Description

The locale-specific link text and corresponding locales for an App Extension.

Fields
Field Name Description
localeCode - String! The locale code for the link text; for example, pt-BR for Portuguese. The locale code should correspond with a control panel-supported language. See the App Extensions documentation for a list of currently supported languages and corresponding locale codes.
value - String! The link text that the user sees when the control panel language corresponds with the accompanying locale code. Suggested length of ≤25 characters; limit 255 characters.
Example
{
  "localeCode": "xyz789",
  "value": "abc123"
}

AppExtensionLabelLocaleInput

Description

A developer-defined list of alternate link text values and their corresponding locale codes.

Fields
Input Field Description
localeCode - String! A locale code that corresponds with a control-panel supported language. For example, de-DE for German. See the App Extensions documentation for a list of currently supported languages and corresponding locale codes.
value - String! The link text value in the language of the locale code. Suggested length of ≤25 characters; limit 255 characters.
Example
{
  "localeCode": "abc123",
  "value": "abc123"
}

AppExtensionModel

Description

The entity type to which an App Extension relates. The path parameter templated into the App Extension URL takes a model property as its argument. For example, an App Extension active on the CUSTOMERS model converts /auth/${id} into /auth/227 for the customer whose ID value is 227.

Values
Enum Value Description

CUSTOMERS

The App Extension appears on the supported customer-related pages and takes Customer properties as arguments.

ORDERS

The App Extension appears on the supported orders-related pages and takes Orders properties as arguments.

PRODUCTS

The App Extension appears on the supported products-related pages and takes Products properties as arguments.

PRODUCT_DESCRIPTION

The App Extension appears on the description field on supported Edit Products pages and takes Products properties as arguments.
Example
"CUSTOMERS"

AppExtensionMutations

Description

Mutations that create, update, and delete App Extensions.

Fields
Field Name Description
createAppExtension - CreateAppExtensionResult Registers a new App Extension to the store and associates it with the requesting API account.
Arguments
updateAppExtension - UpdateAppExtensionResult Updates an existing App Extension registered to the store and associates it with the requesting API account.
Arguments
deleteAppExtension - DeleteAppExtensionResult Deletes an App Extension that belongs to the store and requesting API account.
Arguments
Example
{
  "createAppExtension": CreateAppExtensionResult,
  "updateAppExtension": UpdateAppExtensionResult,
  "deleteAppExtension": DeleteAppExtensionResult
}

AppExtensionsConnection

Description

A connection to a list of items.

Fields
Field Name Description
pageInfo - PageInfo! Information to aid in pagination.
edges - [AppExtensionsEdge] A list of edges.
Example
{
  "pageInfo": PageInfo,
  "edges": [AppExtensionsEdge]
}

AppExtensionsEdge

Description

An edge in a connection.

Fields
Field Name Description
node - AppExtension! The item at the end of the edge.
cursor - String! A cursor for use in pagination.
Example
{
  "node": AppExtension,
  "cursor": "xyz789"
}

Boolean

Description

The Boolean scalar type represents true or false.

Client

Description

A client.

Fields
Field Name Description
scopes - ScopeConnection List of client scopes.
Arguments
before - String
after - String
first - Int
last - Int
Example
{"scopes": ScopeConnection}

CreateAppExtensionInput

Fields
Input Field Description
context - AppExtensionContext! Defines the action that the control panel performs after the user clicks the App Extension label.
label - AppExtensionLabelInput! The locale-aware link text options for the App Extension's menu item. The control panel user sees this text value wherever they have the option to open the App Extension.
model - AppExtensionModel! The entity type to which the App Extension relates; for example, Orders. The model corresponds with the page on which the App Extension appears.
url - String! A relative path with some meaning to your app, most commonly an internally-defined GET route. The path should contain a path parameter that the app expects to be templated into its route, defined as a JavaScript string template expression. For example, /customer/auth/${id}. Currently, id is the only supported parameter. Limit 255 characters.
Example
{
  "context": "LINK",
  "label": AppExtensionLabelInput,
  "model": "CUSTOMERS",
  "url": "xyz789"
}

CreateAppExtensionResult

Fields
Field Name Description
appExtension - AppExtension The response object properties available after creating an App Extension.
Example
{"appExtension": AppExtension}

DataSolutionsMutations

Description

Data solutions mutations.

Fields
Field Name Description
updateDataLayer - UpdateDataLayerResult Update data layer configuration.
Arguments
Example
{"updateDataLayer": UpdateDataLayerResult}

DataSolutionsSettings

Description

Data solutions settings.

Fields
Field Name Description
isDataLayerEnabled - Boolean! Indicates if a data layer(bodl) object is enabled for all storefronts.
Example
{"isDataLayerEnabled": true}

DeleteAppExtensionInput

Fields
Input Field Description
id - ID! The ID of the object.
Example
{"id": "4"}

DeleteAppExtensionResult

Description

The response object property available after deleting an App Extension; the currently available property is the ID of the deleted App Extension.

Fields
Field Name Description
deletedAppExtensionId - ID The ID of the object.
Example
{"deletedAppExtensionId": "4"}

ID

Description

The ID scalar type represents a unique identifier, often used to re-fetch an object or as key for a cache.

Example
"4"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

Long

Description

The Long scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1.

Example
{}

PageInfo

Description

Information about pagination in a connection.

Fields
Field Name Description
hasNextPage - Boolean! When paginating forwards, are there more items?
hasPreviousPage - Boolean! When paginating backwards, are there more items?
startCursor - String When paginating backwards, the cursor to continue.
endCursor - String When paginating forwards, the cursor to continue.
Example
{
  "hasNextPage": false,
  "hasPreviousPage": true,
  "startCursor": "abc123",
  "endCursor": "xyz789"
}

ScopeConnection

Description

A connection to a list of items.

Fields
Field Name Description
pageInfo - PageInfo! Information to aid in pagination.
edges - [ScopeEdge] A list of edges.
Example
{
  "pageInfo": PageInfo,
  "edges": [ScopeEdge]
}

ScopeEdge

Description

An edge in a connection.

Fields
Field Name Description
node - String! The item at the end of the edge.
cursor - String! A cursor for use in pagination.
Example
{
  "node": "xyz789",
  "cursor": "abc123"
}

Store

Description

A store.

Fields
Field Name Description
account - Account An account.
appExtensions - AppExtensionsConnection! A list of App Extensions that the requesting API account has installed on the store.
Arguments
before - String
after - String
first - Int
last - Int
id - ID! The ID of the object.
settings - StoreSettings Store settings.
storeHash - String! Store hash.
storeReferenceId - String! Store reference ID.
Example
{
  "account": Account,
  "appExtensions": AppExtensionsConnection,
  "id": "4",
  "settings": StoreSettings,
  "storeHash": "abc123",
  "storeReferenceId": "abc123"
}

StoreSettings

Description

Store settings.

Fields
Field Name Description
dataSolutions - DataSolutionsSettings! Data solutions.
storeName - String! Store name.
Example
{
  "dataSolutions": DataSolutionsSettings,
  "storeName": "xyz789"
}

StoreSettingsMutations

Description

Store settings mutations.

Fields
Field Name Description
dataSolutions - DataSolutionsMutations! Data solutions mutations.
Example
{"dataSolutions": DataSolutionsMutations}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"xyz789"

System

Description

System settings.

Fields
Field Name Description
time - Long! The current time.
Example
{"time": {}}

UpdateAppExtensionDataInput

Fields
Input Field Description
label - UpdateAppExtensionLabelInput An object that contains all of the desired locale-aware link text options for an App Extension, including new link text options.
url - String A new relative path containing a supported path parameter that the app expects to be templated into its route, defined as a JavaScript string template expression. Currently, id is supported. Limit 255 characters. See the AppExtension response object schema for more detail.
Example
{
  "label": UpdateAppExtensionLabelInput,
  "url": "xyz789"
}

UpdateAppExtensionInput

Fields
Input Field Description
data - UpdateAppExtensionDataInput! The App Extension data to be changed. Currently, only the url and label properties can be updated. Changes to the label object overwrite existing values, rather than upserting. Be sure to send the whole label object you intend the App Extension to have, not just the changes.
id - ID! The ID of the object.
Example
{"data": UpdateAppExtensionDataInput, "id": 4}

UpdateAppExtensionLabelInput

Description

The label of the App Extension.

Fields
Input Field Description
defaultValue - String The link text that the user sees when the control panel language is English or not defined by the developer in label.locales. The defaultValue should be in English. Suggested length of ≤25 characters; limit 255 characters.
locales - [AppExtensionLabelLocaleInput!] A list of alternate link text values and their corresponding locale codes.
Example
{
  "defaultValue": "xyz789",
  "locales": [AppExtensionLabelLocaleInput]
}

UpdateAppExtensionResult

Fields
Field Name Description
appExtension - AppExtension The response object properties available after updating an App Extension.
Example
{"appExtension": AppExtension}

UpdateDataLayerInput

Fields
Input Field Description
isDataLayerEnabled - Boolean! is data layer enabled
Example
{"isDataLayerEnabled": false}

UpdateDataLayerResult

Description

Result of mutation.

Fields
Field Name Description
dataSolutions - DataSolutionsSettings Data solutions object that is updated as a result of mutation.
Example
{"dataSolutions": DataSolutionsSettings}