Interface: GraphQLClientConfig
Defined in: client/GraphQLClient.ts:89
Configuration for the GraphQL client.
Properties
apiKey?
optionalapiKey?:string
Defined in: client/GraphQLClient.ts:93
Standard API key — only used in direct mode.
clientId?
optionalclientId?:string
Defined in: client/GraphQLClient.ts:105
Client identifier for proxy mode (sent as X-Client-ID).
debug?
optionaldebug?:boolean
Defined in: client/GraphQLClient.ts:107
Enable debug logging (default: false). Gates all internal console output.
defaultLanguage?
optionaldefaultLanguage?:string
Defined in: client/GraphQLClient.ts:121
Default language tag (ISO 639-1, e.g. 'NL', 'EN'). When set, services and
helpers that take an optional language parameter fall back to this value.
Pass an explicit language to override per call.
endpoint
endpoint:
string
Defined in: client/GraphQLClient.ts:91
API endpoint URL — direct external API or proxy endpoint.
fetch?
optionalfetch?:FetchImplementation
Defined in: client/GraphQLClient.ts:149
fetch() implementation used for every request. Defaults to the global
fetch, resolved per request (so later polyfills and spies apply).
Supply a request-scoped fetch during SSR to keep the call in-process:
Nitro's event.fetch (Nuxt: useRequestEvent()!.fetch) routes a
relative endpoint like /api/graphql straight to the app's own proxy
handler. With the global fetch, SSR needs an absolute URL and makes a
real network round trip to its own public hostname — which fails with
fetch failed wherever the server can't reach its own ingress.
getAccessToken?
optionalgetAccessToken?:AccessTokenProvider
Defined in: client/GraphQLClient.ts:115
Resolver for the auth access token used in proxy mode. Called on every
request. Defaults to reading localStorage['access_token'] in the
browser, undefined elsewhere. Supply a custom resolver to integrate with
SSR (Next.js cookies, getServerSession), in-memory token stores, or
refresh flows.
headers?
optionalheaders?:Record<string,string>
Defined in: client/GraphQLClient.ts:97
Additional headers attached to every request.
orderEditorApiKey?
optionalorderEditorApiKey?:string
Defined in: client/GraphQLClient.ts:95
Order Editor API key — only used in direct mode for mutations in orderEditorMutations.
orderEditorMutations?
optionalorderEditorMutations?:string[]
Defined in: client/GraphQLClient.ts:127
Mutation names that should be sent with orderEditorApiKey instead of
apiKey in direct mode. Defaults to a built-in list of order-editor
mutations. Override to add custom mutations without an SDK upgrade.
proxyEndpoint?
optionalproxyEndpoint?:string
Defined in: client/GraphQLClient.ts:103
Proxy endpoint for secure mode — falls back to endpoint if not provided.
securityMode?
optionalsecurityMode?:"proxy"|"direct"
Defined in: client/GraphQLClient.ts:101
Security mode: 'proxy' (recommended) or 'direct' (legacy, exposes API keys client-side).
throwOnPartialErrors?
optionalthrowOnPartialErrors?:boolean
Defined in: client/GraphQLClient.ts:137
When the server returns a partial GraphQL response (data present
alongside errors — the normal GraphQL contract), runOperation and the
service methods built on it return the data and, by default, only surface
the errors via the debug log. Set this to true to instead throw a
GraphQLOperationError on any partial-error response, so server-reported
problems can't be silently rendered. Defaults to false (backward
compatible). The low-level client.execute() never throws regardless.
timeout?
optionaltimeout?:number
Defined in: client/GraphQLClient.ts:99
Request timeout in milliseconds (default 30000).