Closed edbrannin closed 6 years ago
(Updated the main comment with a minimal reproduction)
I'm seeing this too, it impacts the Excel transform.
I have PR that hopefully will fix this issue - https://github.com/gatsbyjs/gatsby/pull/5155
@pieh since #5155 was merged, is this issue still relevant?
@pieh has this issue been fixed with #5155?
Ah, yeah - thanks for bringing this up :)
Description
GraphQL fields with whitespace in their names are normalized to contain underscores instead, which is great -- but the values for these fields are all null.
This probably happens with any other not-completely-alphanumeric field name (not just whitespace).
I've minimally reproduced this at https://github.com/edbrannin/gatsby-4751
(I'm open to making a PR, but I'm having a hard time figuring out where the schema-field normalization happens[1] and where would be appropriate to update the actual nodes.)
[1]
packages/gatsby/src/schema/create-key.js
?Steps to reproduce
See https://github.com/edbrannin/gatsby-4751/commit/5ba916264c67e731b63dc45eaca8761a76ca1f2f
Field Name
and valueField Value
Field_Name
(This is also kevzettler/gatsby-source-airtable#2, but near as I can tell the header normalization is happening in Gatsby and it makes sense to keep the field normalization in the same place.)
Expected result
Return a node including
{ Field_Name: "Field Value" }
Actual result
Returns a node including
{ Field_Name: null }
Environment
npm list gatsby
):npm ERR! missing: gatsby@1.9.241, required by gatsby-starter-default@1.0.0
(but runningyarn develop
works just fine)gatsby --version
): 1.9.223 (globally installed)File contents (if changed):
gatsby-node.js
:src/psges/index.js
:Output: