Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

NaN returns invalid JSON #40

Closed
SamuelGHill opened this issue Feb 24, 2021 · 3 comments
Closed

NaN returns invalid JSON #40

SamuelGHill opened this issue Feb 24, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@SamuelGHill
Copy link

SamuelGHill commented Feb 24, 2021

I am building out a GraphQL Server with StepZen and the query https://sociepy.org/covid19-vaccination-subnational/data/api/v1/latest/country_by_iso/FR.json breaks due to a NaN value rather than null value in total_vaccinations_per_100.

// Response from RestAPI

        {
            "region_name": "Corse",
            "region_iso": "FR-COR",
            "date": "2021-02-22",
            "total_vaccinations": 27059,
            "total_vaccinations_per_100": NaN
        },

GraphQL Query

  vaccines(countryISO: "FR") {
  country
  }

Response Error

{
  "data": {
    "vaccines": null
  },
  "errors": [
    {
      "message": "Invalid json content.: invalid character 'N' looking for beginning of value",
      "locations": [
        {
          "line": 58,
          "column": 3
        }
      ],
      "path": [
        "vaccines"
      ]
    }
  ]
}
@lucasrodes
Copy link
Member

Hi @SamuelGHill,
Thanks for your report! Also, happy to see that you find this project useful.

I will start working on this asap, I'll ping you when fixed.

@lucasrodes lucasrodes added the bug Something isn't working label Feb 24, 2021
@lucasrodes lucasrodes self-assigned this Feb 24, 2021
lucasrodes added a commit that referenced this issue Feb 24, 2021
@lucasrodes
Copy link
Member

lucasrodes commented Feb 24, 2021

@SamuelGHill
Could you check now? Thanks!

Also, I'd be happy to learn more about your project 😄 Further feedback is welcome so I can improve the API part of this project.

@SamuelGHill
Copy link
Author

@lucasrodes

Works! Thank you for the quick fix.

And yes, I'd be more than happy to. I'll share my project with you and see what collaborations we can do!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants