Skip to main content

Client configuration

createClient(config) (and the backward-compatible new GraphQLClient(config)) accept a GraphQLClientConfig:

FieldTypeDefaultNotes
endpointstringRequired. Direct API URL or your proxy endpoint.
securityMode'proxy' | 'direct''proxy'Use 'proxy' in production. 'direct' exposes API keys client-side.
proxyEndpointstringendpointOverride for proxy URL when you want endpoint to point at the upstream.
clientIdstringSent as X-Client-ID in proxy mode.
apiKeystringDirect mode only. Ignored in proxy mode (with a warning).
orderEditorApiKeystringDirect mode only. Used for the mutations in orderEditorMutations.
orderEditorMutationsstring[]['orderSetStatus', 'passwordResetLink', 'triggerQuoteSendRequest', 'triggerOrderSendConfirm']Override to route additional mutations through orderEditorApiKey.
headersRecord<string, string>Merged into every request. Also the right slot for application-level proxy cache transports (see Caching recipes).
timeoutnumber30000Request timeout (ms). Triggers AbortController.
debugbooleanfalseGates internal [GraphQL Client] logs. Config-validation warnings always fire.
getAccessToken() => string | undefined | Promise<string | undefined>reads localStorage['access_token'] in browserUse this for SSR (getServerSession, HTTP-only cookies) or in-memory token stores.
defaultLanguagestringISO 639-1 tag (e.g. 'NL'). Service methods that take an optional top-level language and don't receive one fall back to this value. An explicit language on the call always wins.
throwOnPartialErrorsbooleanfalseOn a partial response (data and errors), services return the data and debug-log the errors. Set true to throw GraphQLOperationError instead. client.execute() never throws regardless.

The exact, generated type definition is in the API Reference.

See also: Proxy contract · Authentication · Per-operation cache hints · Caching recipes.