Using graphql storefront api mutations

New Member
3 0 0

I am testing and building a headless shopify using gatsby-shopify-starter template. (developing in React)

As far as I know I can easily query all the product and collection information with the help of 'gatsby-source-shopify'.


However I am having trouble using Storefront API, specially creating a customer using mutation.

I used gatsby-source-graphql plugin to build the admin graphql schema :


            resolve: `gatsby-source-graphql`,
            options: {
                typeName: 'ShopifyAdmin',
                fieldName: 'admin',
                url: ``,
                headers: {
                    'X-Shopify-Access-Token': process.env.SHOPIFY_SHOP_PASSWORD,
                fetchOptions: {
                    method: 'POST',



My question is: How would you be able to use mutation to the Do I need to install and use apollo client in order to use mutation?

Already tested with GraphiQL app and with Insomnia the following GraphQL query:


mutation customerCreate($input: CustomerCreateInput!) {
  customerCreate(input: $input) {
    customerUserErrors {
    customer {



Now how am I able to do this in my headless shopify-gatsby app using React? Are there any guides for it?

Replies 0 (0)