Skip to main content
The Admin API client provides both GraphQL and REST interfaces for interacting with the Shopify Admin API.

createAdminApiClient()

Creates a GraphQL client for the Shopify Admin API.

Parameters

string
required
The Shopify store domain (e.g., my-store.myshopify.com)
string
required
The Admin API version to use (e.g., 2025-10)
string
required
Admin API access token for authentication
string
Optional prefix to add to the User-Agent header
number
default:"0"
Number of retry attempts for failed requests
CustomFetchApi
Custom fetch implementation (defaults to global fetch)
ApiClientLogger
Logger function for debugging and monitoring requests
boolean
Set to true to skip server-side usage validation during testing

Returns

object
Admin API client instance with the following properties:

Client Methods

fetch()

Executes a GraphQL operation and returns the raw response.
string
required
GraphQL query or mutation string
object
Request options:
  • variables: GraphQL variables object
  • headers: Additional headers to merge with defaults
  • apiVersion: Override the default API version
  • retries: Override the default retry count
  • signal: AbortSignal for request cancellation

request()

Executes a GraphQL operation and returns parsed response data.
Returns a ClientResponse<TData> object:
TData
The GraphQL response data
ResponseErrors
Error information if the request failed:
  • networkStatusCode: HTTP status code
  • message: Error message
  • graphQLErrors: Array of GraphQL errors
  • response: Raw Response object
object
GraphQL extensions from the response
Headers
Response headers

Example Usage

Type Safety

The Admin API client supports TypeScript type generation for full type safety. See the API Codegen guide for details.