gatsby-source-google-spreadsheets
gatsby-source-google-spreadsheets copied to clipboard
Column with phone number with infix '-' converts to 'number'
Describe the bug When a column contains only phone numbers with (in Germany) charactaristic infix '-' (minus sign) for formatting, then the column is inferred to be 'number'. On the subsequent parsing of the value an error occurs, 'GraphQLError: Float cannot represent non numeric value: NaN'
To Reproduce Steps to reproduce the behavior:
- Add a sheet with a column ('phone')
- Add a phone number ('0177-420420')
- Start a gatsby project with gatsby-source-google-spreadsheets plugin configured
- Wait for the sheet to load and process
- See error
Expected behavior The column should be read as 'string'
Screenshots n/a
Desktop (please complete the following information):
- OS: macOS 11.7, Netlify/nodejs18
- Version HEAD, 3.0.9
Excerpt from the log output from npm run build showing this error. Just to further illustrate the issue.
12:52:37 PM: error There was an error in your GraphQL query:
12:52:37 PM: Float cannot represent non numeric value: NaN
12:52:37 PM: 24 | }
12:52:37 PM: 25 | }
12:52:37 PM: 26 | groups: allGoogleGroupsSheet(filter: {active: {eq: true}}) {
12:52:37 PM: 27 | nodes {
12:52:37 PM: 28 | id
12:52:37 PM: 29 | active
12:52:37 PM: 30 | name
12:52:37 PM: 31 | address
12:52:37 PM: > 34 | phone
12:52:37 PM: | ^
12:52:37 PM: 36 | time
12:52:37 PM: 37 | }
12:52:37 PM: 38 | }
12:52:37 PM: 39 | }
12:52:37 PM: File path: /opt/build/repo/src/pages/index.tsx
Sheet content:
| active | name | address | phone |
|---|---|---|---|
| TRUE | Arijana | 0177-420420 |