-
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
gatsby-plugin-schema-snapshot Issue with Contentful LongText fields #19674
Comments
Thanks, I'll look into this! If you check the field type for |
@stefanprobst yes, |
@stefanprobst is there any other useful info I can provide for this particular ticket? |
Can you make a minimum reproduction? Then I can take a look. It is hard to help without actual code at hand. |
Sure, no problem. Apologies for the multi-step process but it is necessary since this involves Contentful. Let me know if this is helpful or if you need anything else. Reproducible Test Case
|
OK, I think I know what is going on here. Our I do see related warnings in the console:
|
@ryanwiemer We should address this in the core but in the meantime, you could use Following worked for me with your repro: // in site's gatsby-node.js:
exports.createSchemaCustomization = ({ actions }) => {
const typeDefs = `
type contentfulPostBodyTextNode implements Node
@childOf(types: ["ContentfulPost"]) {
id: ID!
}
type contentfulPageMetaDescriptionTextNode implements Node
@childOf(types: ["ContentfulPage"]) {
id: ID!
}
type contentfulPageBodyTextNode implements Node
@childOf(types: ["ContentfulPage"]) {
id: ID!
}
type contentfulPostMetaDescriptionTextNode implements Node
@childOf(types: ["ContentfulPost"]) {
id: ID!
}
type MarkdownRemark implements Node
@childOf(types: [
"contentfulPostBodyTextNode",
"contentfulPostMetaDescriptionTextNode",
"contentfulPageBodyTextNode",
"contentfulPageMetaDescriptionTextNode"
]) {
id: ID!
}
`
actions.createTypes(typeDefs)
} |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Description
I recently tried using
gatsby-plugin-schema-snapshot
to create an explicit snapshot of the schema for a project that usesgatsby-source-contentful
. This works as expected with the exception of LongText fields in Contentful. Per the documentation LongText fields should actually be an object rather than a string.Generated type using
gatsby-plugin-schema-snapshot
for a field namedbody
which is a LongText field in Contentful.This causes the following part of the query to fail if the actual content doesn't exist:
Steps to reproduce
gatsby-plugin-schema-snapshot
and add it to thegatsby-config.js
gatsby build
and view the snapshot file createdThe text was updated successfully, but these errors were encountered: