Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
febeling opened this issue Nov 18, 2023 · 2 comments · May be fixed by #37
Open

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

febeling opened this issue Nov 18, 2023 · 2 comments · May be fixed by #37

Comments

@febeling
Copy link

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 febeling linked a pull request Nov 18, 2023 that will close this issue
@febeling
Copy link
Author

febeling commented Nov 19, 2023

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
Copy link
Author

Sheet content:

active name address phone
TRUE Arijana 0177-420420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant