Contentful Plugin: Should output complete schema regardless of whether content is available
See original GitHub issueDescription
When content types are created but are not yet populated they do not include any of their fields in the GraphQL schema, this means that we cannot write queries against those fields which will work when the data is available.
This issue would arise if the content was available but subsequently unpublished or deleted.
The content model can be represented in the schema by using the schema customisation API rather than using inference.
Partially discussed here: https://github.com/gatsbyjs/gatsby/issues/1517
Note: I appreciate this is mentioned in the plugin’s readme but this is a serious drawback of the plugin.
A similar fix was put in place on the Kentico Kontent source plugin last year:
Steps to reproduce
- Create a new content model in Contentful.
- Setup the source plugin with default settings, space ID and access token.
- Run gatsby develop and inspect the schema
Expected result
The schema should include the full model rather than a “skeleton” structure with only the default fields.
Actual result
The type exists but does not include the full model, only the base Contentful fields.
Environment
System:
OS: Windows 10 10.0.19041
CPU: (12) x64 Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz
Binaries:
Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 87.0.4280.88
Edge: Spartan (44.19041.423.0), Chromium (87.0.664.66)
npmPackages:
gatsby: ^2.26.1 => 2.29.3
gatsby-image: ^2.5.0 => 2.8.0
gatsby-plugin-alias-imports: ^1.0.5 => 1.0.5
gatsby-plugin-layout: ^1.7.0 => 1.7.0
gatsby-plugin-manifest: ^2.6.1 => 2.9.1
gatsby-plugin-offline: ^3.4.0 => 3.7.1
gatsby-plugin-react-helmet: ^3.4.0 => 3.7.0
gatsby-plugin-sass: ^2.8.0 => 2.8.0
gatsby-plugin-sharp: ^2.8.0 => 2.11.2
gatsby-source-contentful: ^4.3.1 => 4.3.1
gatsby-source-filesystem: ^2.5.0 => 2.8.1
gatsby-transformer-sharp: ^2.6.0 => 2.9.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top GitHub Comments
Definitely not stale, or shouldn’t be…
Nope, not stale.