gatsby-transformer-csv sort by integer field not working, is sorting as string #26607
Replies: 3 comments
-
I think @pvdz might know the answer to this. He was working on some performance related work in those files. or @vladar might know too |
Beta Was this translation helpful? Give feedback.
-
@AdamQuadmon were you able to figure this out? I'm having the same issue. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
The Gatsby plugin is a very thin layer on top of the Additionally, according to the readme, it should generate numbers. These should be sortable numerically https://www.gatsbyjs.com/plugins/gatsby-transformer-csv/#parsing-algorithm So I guess we'd need tos ee an example of your input csv to figure out what's up :) I don't know about Adam's issue (and I'm sorry I missed the ping). |
Beta Was this translation helpful? Give feedback.
-
Summary
I'm using gatsby-transformer-csv.
I want to sort by fieldNumber as integer.
Values are sorted as string even if displayed as integer using
createTypes
ingatsby-node.js
There is also a SO question from another user:
https://stackoverflow.com/questions/63508542/how-can-gatsby-graphql-sort-an-integer-field-numerically-rather-than-alphabetica
Relevant information
gatsby-node.js
test.csv
query
output
If I don't use the createType, values are displayed as strings and the order is the same
Beta Was this translation helpful? Give feedback.
All reactions