Gatsby: Why is graphql returning a number?

Created on 12 Feb 2019  路  6Comments  路  Source: gatsbyjs/gatsby

For some reason, a query in GraphiQL that returns a block of JSON data simply returns a 9-digit number.

const query = graphql`
  query allPrismicCaseStudy {
     edges {
       node {
         uid
       }
     }
   }
`;

returns 348885080

const query = graphql`
  query{
    site{
      port
    }
  }
`;

returns 3416814672

I am using the hello world starter. Whitespace seems to impact the number's output

question or discussion

All 6 comments

Can you paste entire file snippet? Do you by any chance try to use query variable directly? This won't contain data, but hash of the query content (used internally by gatsby)

That appears to be the issue.

I'm experiencing same issue. Pretty much same query returns 9-digit number. Is there any update on this?

Same issue here!

@PieterT2000 , @onderbakirtas , just faced with the same issue.
But fixed this, it was mistake in my code!
From docs: https://www.gatsbyjs.com/docs/page-query/

Below the HomePage component declaration, export a new constant called query. The name of the constant isn鈥檛 important, as Gatsby looks for an exported graphql string from the file rather than a specific variable. Note that you can only have one page query per file.

Hope, this will be useful.

@PieterT2000 , @onderbakirtas , just faced with the same issue.
But fixed this, it was mistake in my code!
From docs: https://www.gatsbyjs.com/docs/page-query/

Below the HomePage component declaration, export a new constant called query. The name of the constant isn鈥檛 important, as Gatsby looks for an exported graphql string from the file rather than a specific variable. Note that you can only have one page query per file.

Hope, this will be useful.

Thanks for taking time to answer it. I have solved it just like you. Mistakes here to be made.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

ghost picture ghost  路  3Comments

benstr picture benstr  路  3Comments

totsteps picture totsteps  路  3Comments