-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot query field "bodyRichText" on "ContentfulBlogPost" using gatsby-source-contentful v4.6.4 #33323
Comments
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Has anyone been able to at least confirm this issue by chance? |
cc @axe312ger |
Do you have actual content in your Rich Text field? If not, you run into the bug we try to fix via #31385 Also, v4.6.4 is for Gatsby v2. There have been significant bugfixes in the source plugin and Gatsby itself since that release. Please consider migrating to more up to date versions of the plugin & core. |
Hi! Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks! |
@axe312ger and @LekoArts thanks for the reply. Apologies for my delayed response. For some reason github didn't notify me of your comments. In case you didn't notice, I already edited the post on 9/29/21 and added a link to a very simple repo I created that reproduces this issue even with the latest version of gatsby. So in response to your comment, unfortunately this issue persists well beyond 4.6.4. And yes, there is indeed actual content in the rich text fields. I would humbly ask that this issue be reopened, since it is unresolved and I have provided a minimal reproducible example on or about the time of the OP. Thanks guys. |
I'll have a look. Thanks for the repo |
I installed your repo. It works fine for me: You logs above show Gatsby v2. The version of gatsby-source-contentful that is compatible with Gatsby v2 might have some rich text bugs. Your example repo uses Edit: Might it be the case, that your field is called |
@axe312ger I think I may have misunderstood the docs. Your comment about the field name triggered an 'oh I'm an idiot' moment. When reading the docs, it gives bodyRichText as a field. I thought it was a special function of the contentful plugin that simplifies (or trims) the returned rich text in an easier to use manner. This discussion on github about Gatsby and contentful rich text helped reinforce this notion. However, it seems that bodyRichText is simply a placeholder name for whatever the name of your rich text field is. If this is the case, sorry; I pretty much wasted your time. |
No worries! Thats how the plugin works. Each of your Contentful fields will be turned into a Gatsby GraphQL field. I gonna update the README to make it more clear :) |
Preliminary Checks
Description
** EDIT ** I created a repo here that reproduces this error even with the latest version of gatsby and gatsby-source-contentful
I'm using gatsby-source-contentful v4.6.4 in a blog I'm working on with gatsby.
I have blog posts already on contentful CMS, and I'm able to query everything EXCEPT my rich text successfully.
In the GraphiQL interface in the browser, or in the project itself, I get the following message when I try to use
bodyRichText
.Here is an example of a basic query I'm tring to use:
I can do something even more simple, such as this:
And I still get the same result.
Reproduction Link
https://github.com/justsilencia/gatsby-contentful-rt-error
Steps to Reproduce
...
Expected Result
To receive formatted rich text from gatsby-source-contentful v4.6.4 plugin via graphql query.
Actual Result
Error: Cannot query field "bodyRichText" on type contentfulBlogPost
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: