gatsby-source-google-spreadsheets icon indicating copy to clipboard operation
gatsby-source-google-spreadsheets copied to clipboard

Column with phone number with infix '-' converts to 'number'

Open febeling opened this issue 1 year ago • 2 comments

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:

  1. Add a sheet with a column ('phone')
  2. Add a phone number ('0177-420420')
  3. Start a gatsby project with gatsby-source-google-spreadsheets plugin configured
  4. Wait for the sheet to load and process
  5. 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

febeling avatar Nov 18 '23 19:11 febeling

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

febeling avatar Nov 19 '23 11:11 febeling

Sheet content:

active name address phone
TRUE Arijana 0177-420420

febeling avatar Nov 19 '23 11:11 febeling