create Storefront Clientutility
The function creates helpers that enable you to quickly query the Shopify Storefront API.
When used on the server, it is recommended to use the prop. When used on the client, it is recommended to use the
prop or consider using
instead.
StorefrontClientReturn
Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. This method uses the private Server-to-Server token which reduces the chance of throttling but must not be exposed to clients. Server-side calls should prefer using this over .
By default, it will use the config you passed in when calling . However, you can override the following settings on each invocation of
:
Note that defaults to what you configured in
and defaults to
'json'
, but a specific call may require using graphql
. When using on the
body
, use 'json'
; otherwise, use 'graphql'
.
Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. This method uses the public token which increases the chance of throttling but also can be exposed to clients. Server-side calls should prefer using .
By default, it will use the config you passed in when calling . However, you can override the following settings on each invocation of
:
Note that defaults to what you configured in
and defaults to
'json'
, but a specific call may require using graphql
. When using on the
body
, use 'json'
; otherwise, use 'graphql'
.
Creates the fully-qualified URL to your myshopify.com domain.
By default, it will use the config you passed in when calling . However, you can override the following settings on each invocation of
:
Creates the fully-qualified URL to your store's GraphQL endpoint.
By default, it will use the config you passed in when calling . However, you can override the following settings on each invocation of
: