Skip to content
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

fix: prefix graphql type names with underscore if it starts with number #10007

Merged
merged 1 commit into from
Nov 19, 2018

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Nov 17, 2018

if object or array is under field that starts with number it will cause graphql to fail with:

Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "6E0F4D382F504Ac5837DF8B7C8618485_2" does not.

to workaround it - prefix type name with _ if it starts with number

fixes #9950

/cc @phonoman

@pieh pieh requested a review from a team as a code owner November 17, 2018 21:27
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pieh pieh merged commit 1d2a9be into gatsbyjs:master Nov 19, 2018
@pieh pieh deleted the graphql-normalize-type-names branch November 19, 2018 20:58
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
…er (gatsbyjs#10007)

if object or array is under field that starts with number it will cause graphql to fail with:
```
Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "6E0F4D382F504Ac5837DF8B7C8618485_2" does not.
```

to workaround it - prefix type name with `_` if it starts with number

fixes gatsbyjs#9950

/cc @phonoman
@pieh pieh restored the graphql-normalize-type-names branch May 17, 2020 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gatsby-source-drupal] Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "" does not.
2 participants