moltin / gatsby-source-moltin

🚀 Gatsby source plugin for building Elastic Path Commerce Cloud powered eCommerce websites
https://www.gatsbyjs.org/packages/@moltin/gatsby-source-moltin
MIT License
21 stars 4 forks source link

Cannot query field "allMoltinProduct" on type "Query". #32

Closed Jeerjmin closed 5 years ago

Jeerjmin commented 5 years ago

I have try running

{
  allMoltinProduct {
    edges {
      node {
        id
        name
        description
        slug
        sku
        categories {
          id
          name
        }
      }
    }
  }
}

{ "errors": [ { "message": "Cannot query field \"allMoltinProduct\" on type \"Query\".", "locations": [ { "line": 2, "column": 3 } ], "stack": [ "GraphQLError: Cannot query field \"allMoltinProduct\" on type \"Query\".", " at Object.Field (C:\Users\User\WebstormProjects\new-gatsby-ecomm\ecommerce-gatsby-tutorial\node_modules\graphql\validation\rules\FieldsOnCorrectType.js:53:31)", " at Object.enter (C:\Users\User\WebstormProjects\new-gatsby-ecomm\ecommerce-gatsby-tutorial\node_modules\graphql\language\visitor.js:324:29)", " at Object.enter (C:\Users\User\WebstormProjects\new-gatsby-ecomm\ecommerce-gatsby-tutorial\node_modules\graphql\language\visitor.js:375:25)", " at visit (C:\Users\User\WebstormProjects\new-gatsby-ecomm\ecommerce-gatsby-tutorial\node_modules\graphql\language\visitor.js:242:26)", " at validate (C:\Users\User\WebstormProjects\new-gatsby-ecomm\ecommerce-gatsby-tutorial\node_modules\graphql\validation\validate.js:54:22)", " at C:\Users\User\WebstormProjects\new-gatsby-ecomm\ecommerce-gatsby-tutorial\node_modules\express-graphql\dist\index.js:154:52", " at process._tickCallback (internal/process/next_tick.js:68:7)" ] } ] }

node -v v10.16.0

windows 10

added right client_id in gatsby-config.js

{
      resolve: `@moltin/gatsby-source-moltin`,
      options: {
        client_id: 'cliend_id',
      },
    },
notrab commented 5 years ago

@Jeerjmin you'll need to set the client_id to your actual Moltin client_id. This can be found in the Dashboard.

Or you have no products 😃

I hope this helps 😄

Jeerjmin commented 5 years ago

@notrab I added actual cliend_id, i just don't want show it in issue. I have products

notrab commented 5 years ago

@Jeerjmin are the products set to live?

Jeerjmin commented 5 years ago

@notrab This helps, thanks you!

notrab commented 5 years ago

Thanks @Jeerjmin - We're working to improve the error message here and potentially provide some info if there are no nodes built and you expect there to be that this might be the case.

Glad it's working!