Git Product home page Git Product logo

Comments (4)

hmeissner avatar hmeissner commented on August 18, 2024

Hey @akalogiros, the problem you are running into is likely due to the fact that Gatsby takes the data it gets from your main config query and puts it in it's own data layer.

Because of this, the query you have to use in your app's code differs from what you would normally use when querying GraphCMS endpoint directly.

You can access localhost:xxxx/___graphql to see what gatsby did with the data from your endpoint and how to query for it.

from gatsby-source-graphcms.

akalogiros avatar akalogiros commented on August 18, 2024

Hello @hmeissner,

thanks a lot for your input.

I tried to do this over localhost:xxxx/___graphql but problem persist.

on the contrary when i am bulding my site with gatsby develop i can see in the command line that my data are correctly retrieved

capture

the error according localhost:xxxx/___graphql is at line allCurrentEvents & aAllPastEvents and its says Cannot query field allCurrentEvents on type rootQueryType

from gatsby-source-graphcms.

hmeissner avatar hmeissner commented on August 18, 2024

Yes this is all perfectly normal. You can see that Gatsby's graphiql is highlighting your queries as non-existent in the created API. You have to open up the docs on the right hand side in graphiql and look at how your data has been added to Gatsby. Then construct your queries according to that generated shape.

The data you added is probably structured by Gatsby in a way that's accessible within your app using a query like this:

query SiteTitleQuery2 {
  allCurrentEvents{
    edges {
      node {
        tip
      }
    }
  } 
}

from gatsby-source-graphcms.

hmeissner avatar hmeissner commented on August 18, 2024

Closing this as that does not seem to be in issue with the plugin itself. Will reopen this if it turns out otherwise. If you have any more problems with this @akalogiros please PM me on our community Slack.

from gatsby-source-graphcms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.