Comments (10)
@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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Assets and localizations HOT 2
- Previous and next navigation for posts filtered by Category in Gatsby project not working HOT 3
- [gatsby-source-graphcms]: Problem building GraphCMS nodes // Error: Bad Request HOT 1
- Dependency Dashboard
- on upgrading to Gatsby 4 return null on build HOT 9
- When build website get the following error "Cannot query field "allGraphCmsPost" on type "Query"" . HOT 2
- Problem building GraphCMS nodes when upgrading to Gatsby v4 HOT 8
- Local images are null on gatsby build, but correct in dev mode (Gatsby v4) HOT 36
- Make a note on Granular Permissions usage
- concurrency error HOT 2
- gatsbyImageData return a wrong structs for some images HOT 1
- Markdown nodes null in production HOT 8
- Add ability to serve images in Webp format HOT 5
- Update baseURI to 'https://media.graphassets.com'
- Gastby build - connect ETIMEDOUT HOT 4
- Gatsby V2 fails to build fragments when model has nested components
- Locales not working through relations HOT 1
- [Updated] How can I identify a referenced component's type? HOT 6
- Error: Too Many Requests HOT 11
- Gatsby 5 support? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-graphcms.