You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine I have two files, number.json and string.json within the same directory. The only different is the type of the value.
{
"name": "Number",
"value": 123
}
{
"name": "String",
"value": "123"
}
Using gatsby-source-filesystem and gatsby-transformer-json, only name becomes available within GraphQL. Because the value types are different, the data is not added to GraphQL and is not queryable.
Changing both to use the same data type would make it work.
Is this a known issue or desired behavior? I can produce a smaller test case, if needed.
FWIW, I don't think this is an issue with either of those two plugins because createNode(jsonNode) within gatsby-transformer-json receives the correct object.
The text was updated successfully, but these errors were encountered:
Yes, Gatsby ignores fields with inconsistent types.
So beyond making sure all the fields are the same type, you could also put these files in different directories so that their type name is different. JSON files with single objects in them get a type name derived from the directory they're in.
Imagine I have two files,
number.json
andstring.json
within the same directory. The only different is the type of thevalue
.Using
gatsby-source-filesystem
andgatsby-transformer-json
, onlyname
becomes available within GraphQL. Because thevalue
types are different, the data is not added to GraphQL and is not queryable.Changing both to use the same data type would make it work.
Is this a known issue or desired behavior? I can produce a smaller test case, if needed.
FWIW, I don't think this is an issue with either of those two plugins because
createNode(jsonNode)
withingatsby-transformer-json
receives the correct object.The text was updated successfully, but these errors were encountered: