gatsby-source-contentful `useNameForId` is inconsistently applied when creating the graphql schema
See original GitHub issueDescription
Even when useNameForId
is set to false
for gatsby-source-contentful
’s gatsby config, the startup process still applies a regexp validation to the content type name. This prevents using emojis in content type names, even when the content type id is used in the graphql schema.
Steps to reproduce
- Create a content type in Contentful
- Set
useNameForId
tofalse
ingatsby-config
- Verify that your gatsby dev server can start
- Change the name of your Contentful content type to add an emoji
- Restart your dev server
- Verify that your dev server is not able to start up and that you see the following error in your logs:
GraphQLError: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "YOUR_CONTENT_TYPE_NAME" does not.
Expected result
Gatsby allows me to use emojis in the content type name, so long as the content type id is used to build the graphql schema.
Actual result
I cannot start the dev server when there is an emoji in the content type name, and useNameForId
is false
.
Environment
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.12.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Languages:
Python: 3.8.1 - /Users/davidhouse/.pyenv/shims/python
Browsers:
Chrome: 87.0.4280.67
Firefox: 83.0
Safari: 14.0
npmPackages:
gatsby: ^2.24.15 => 2.24.23
gatsby-background-image: ^1.1.1 => 1.1.1
gatsby-image: ^2.4.14 => 2.4.14
gatsby-plugin-anchor-links: ^1.1.1 => 1.1.1
gatsby-plugin-emotion: ^4.3.10 => 4.3.10
gatsby-plugin-env-variables: ^2.0.0 => 2.0.0
gatsby-plugin-manifest: ^2.4.21 => 2.4.21
gatsby-plugin-netlify: ^2.3.11 => 2.3.11
gatsby-plugin-react-helmet: ^3.3.10 => 3.3.10
gatsby-plugin-root-import: ^2.0.5 => 2.0.5
gatsby-plugin-segment-js: ^3.3.0 => 3.3.0
gatsby-plugin-sentry: ^1.0.1 => 1.0.1
gatsby-plugin-sharp: ^2.6.24 => 2.6.24
gatsby-plugin-sitemap: ^2.4.11 => 2.4.11
gatsby-plugin-typescript: ^2.4.16 => 2.4.16
gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.12 => 1.1.12
gatsby-plugin-zendesk-chat: ^1.1.4 => 1.1.4
gatsby-source-contentful: ^2.3.55-next.21 => 2.3.55-next.21+11a5a7bee4
gatsby-source-filesystem: ^2.3.23 => 2.3.23
gatsby-transformer-remark: ^2.8.27 => 2.8.27
gatsby-transformer-sharp: ^2.5.12 => 2.5.12
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
gatsby-source-contentful
The nodes will be created in your site's GraphQL schema under contentful${entryTypeName} and allContentful${entryTypeName} . In all cases querying for nodes ...
Read more >I can't connect to Contentful with Gatsby - Stack Overflow
I use the "hello world" starter, so I added the gatsby-source-contentful plugin myself, and it didn't create a "contentful-data.json" file, ...
Read more >10 Gatsby Plugins for Contentful You Should Know About
It can calculate a reading time estimate for any content from any source in your Gatsby project's GraphQL schema. How to Install. To...
Read more >npm:@luudjanssen/gatsby-source-contentful - Skypack.dev
Gatsby source plugin for building websites using the Contentful CMS as a ... Asset nodes will be created in your site's GraphQL schema...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 💪💜
ack