Git Product home page Git Product logo

Comments (10)

notrab avatar notrab commented on August 18, 2024 2

@irenama I've asked @jpedroschmitz if he'll take a look at this when he has time. I haven't really spent a huge amount of time with this plugin (or Gatsby) to be very helpful - so I'll leave it to the expert @jpedroschmitz to investigate.

from gatsby-source-graphcms.

jpedroschmitz avatar jpedroschmitz commented on August 18, 2024 2

Hey, I've been looking into this problem, and it looks like there's a bug on the Gatsby reporter.

I opened a PR (#188) that will display properly formatted messages, which allows us to understand the errors. In my case, while trying to reproduce it, I found that it was happening due to missing permissions on my GraphCMS token.

Let me know if there are any questions 💜

from gatsby-source-graphcms.

irenama avatar irenama commented on August 18, 2024 1

Hi @notrab are there any updates on this? 🙂

At the moment it seems like I can't query any DRAFT content from my GraphCMS project ...or is there a way around that?
All my 'mixed' (DRAFT & PUBLISHED) content tokens default to PUBLISHED items and the token with which I would only want to request DRAFT content breaks the build with the [object Object] [object Object] error.

I'm grateful for any insights, thanks! 🙏

from gatsby-source-graphcms.

notrab avatar notrab commented on August 18, 2024

Using 2.4.0 the message is now:

 ERROR 
gatsby-source-graphcms: Problem building GraphCMS nodes [object Object]
  Error: [object Object]

API endpoints in these examples are also set to public.

from gatsby-source-graphcms.

notrab avatar notrab commented on August 18, 2024

It appears after this PR https://github.com/GraphCMS/gatsby-source-graphcms/pull/166/files by @ynnoj was merged, that any API tokens that have just DRAFT access will throw the above error.

from gatsby-source-graphcms.

killfill avatar killfill commented on August 18, 2024

Maybe it would be a good idea to default to PUBLISHED and DRAFT in here?

The failure seems to happen when the default PUBLISHED is used, and after you create a new graphcms project which only has DRAFT data. 😁

Btw, a better error output could be made here and here, by doing something like

new Error(JSON.stringify(response.errors))

Thanks!

from gatsby-source-graphcms.

killfill avatar killfill commented on August 18, 2024

Ok, its not 100% correct. Maybe the default should be DRAFT only, as having them both would require the access to be open for both env's at the endpoint side as well.

from gatsby-source-graphcms.

notrab avatar notrab commented on August 18, 2024

Yeah the reason it's set to PUBLISHED is due to that security around the data. DRAFT tends to be used for staging/dev mode.

@killfill I'd happily accept a PR for the JSON.stringify update. I think response.errors are thrown in a few places.

We really should get some contributor docs on here 😅

from gatsby-source-graphcms.

jpedroschmitz avatar jpedroschmitz commented on August 18, 2024

We have released 2.5.2 on NPM that should fix the issue. 🎉

To install, just run yarn add gatsby-source-graphcms@latest or npm i gatsby-source-graphcms@latest.

I'll be closing this issue for now. If there are any other problems you might have, don't hesitate to open an issue or reaching out!

from gatsby-source-graphcms.

notrab avatar notrab commented on August 18, 2024

I've added some FAQs to the README @irenama to help others seeing this issue.

I think the issue is due to the plugin having a default locale it uses to query, and the token not having the correct permissions. Unless both are configured the same, it's hard to solve, as far as I know.

If you have any ideas on how we can address this, I'd be happy to merge a PR.

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.