Closed devzakir closed 2 years ago
Sorry about this mess! I am new to Gatsby & shopify. I forgot to add collections
in the plugin options
{
resolve: "gatsby-source-shopify",
options: {
password: process.env.SHOPIFY_SHOP_PASSWORD,
storeUrl: process.env.GATSBY_SHOPIFY_STORE_URL,
shopifyConnections: ["collections"],
},
},
Preliminary Checks
Description
I am trying to pull the collections list from shopify using
gatsby-source-shopify
plugin. I have checked the permission, it was all good. Don't know why I am getting this.Screenshot & error details attached below!
Reproduction Link
https://github.com/devzakir/gatsby-shopify-graphql
Steps to Reproduce
clone the repo
install packages
add shopify keys in the env file
Visit the graphql page http://localhost:8000/___graphql
Execute the query
{ allShopifyCollection (sort: { fields: [title] }) { edges { node { id title handle products { title images { originalSrc } shopifyId handle description availableForSale priceRange { maxVariantPrice { amount } minVariantPrice { amount } } } } } } }
{ "errors": [ { "message": "Cannot query field \"allShopifyCollection\" on type \"Query\". Did you mean \"allShopifyProduct\" or \"allShopifyProductImage\"?", "locations": [ { "line": 2, "column": 2 } ], "extensions": { "stack": [ "GraphQLError: Cannot query field \"allShopifyCollection\" on type \"Query\". Did you mean \"allShopifyProduct\" or \"allShopifyProductImage\"?", " at Object.Field (/Users/devzakir/Dev/clients/Fiverr/nuformat-gatsby/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:48:31)", " at Object.enter (/Users/devzakir/Dev/clients/Fiverr/nuformat-gatsby/node_modules/graphql/language/visitor.js:323:29)", " at Object.enter (/Users/devzakir/Dev/clients/Fiverr/nuformat-gatsby/node_modules/graphql/utilities/TypeInfo.js:370:25)", " at visit (/Users/devzakir/Dev/clients/Fiverr/nuformat-gatsby/node_modules/graphql/language/visitor.js:243:26)", " at validate (/Users/devzakir/Dev/clients/Fiverr/nuformat-gatsby/node_modules/graphql/validation/validate.js:69:24)", " at graphqlMiddleware (/Users/devzakir/Dev/clients/Fiverr/nuformat-gatsby/node_modules/express-graphql/index.js:98:38)", " at runMicrotasks ()",
" at processTicksAndRejections (internal/process/task_queues.js:95:5)"
]
}
}
]
}
Config Flags