swapi-graphql
swapi-graphql copied to clipboard
The API doesn't work (almost): most of the returned property values are `null`
There must be something wrong with schemas or the way the individual records are fetched.
- Go to https://swapi-graphql.netlify.app/
- Try any query, requesting different fields. Example:
query MyQuery {
allPlanets {
edges {
cursor
node {
climates
created
diameter
edited
name
}
}
}
}
- Observe that most of the fields return as
null
{
"data": {
"allPlanets": {
"edges": [
{
"cursor": "YXJyYXljb25uZWN0aW9uOjA=",
"node": {
"climates": null,
"created": null,
"diameter": null,
"edited": null,
"name": "Tatooine"
}
},
{
"cursor": "YXJyYXljb25uZWN0aW9uOjE=",
"node": {
"climates": null,
"created": null,
"diameter": null,
"edited": null,
"name": "Alderaan"
}
},
{
"cursor": "YXJyYXljb25uZWN0aW9uOjI=",
"node": {
"climates": null,
"created": null,
"diameter": null,
"edited": null,
"name": "Yavin IV"
}
},
...
...
]
}
}
I am having the same issues. I use swapi-graphql for an introductory workshop to GraphQL – back in October everything used to be fine but today all participants complained that about null values.
The current implementation doesn't fetch all the necessary item-level data, which leads to incomplete cache results. This PR addresses the issue by retrieving full details for each resource entry: https://github.com/graphql/swapi-graphql/pull/243