sociepy / covid19-vaccination-subnational

🌍💉 Global COVID-19 vaccination data at the regional level.

Home Page:https://sociepy.org/covid19-vaccination-subnational

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NaN returns invalid JSON

SamuelGHill opened this issue · comments

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"
      ]
    }
  ]
}

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.

@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.

@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!