ApiV2-GraphQL-Docs icon indicating copy to clipboard operation
ApiV2-GraphQL-Docs copied to clipboard

All queries fail when one fails

Open qgustavor opened this issue 5 years ago • 5 comments

It's similar to this issue: when doing multiple queries and some fails it returns 404 and null on all fields.

As an example here's a simplified GraphQL query, the variables and the returned data:

query ($id: Int, $userName: String, $type: MediaType){
  MediaList(userName: $userName, mediaId: $id, type: $type) {
    status
  }
  Media(id: $id, type: $type) {
    episodes
  }
}
{"userName": "qgustavor", "type": "ANIME", "id": 103871}
{
  "data": {"MediaList": null, "Media": null},
  "errors": [{
    "message": "Not Found.", "status": 404, "locations":[{"line": 3, "column": 3}]
  }]
}
  • Expected result: data from the second query is returned.
  • Current behavior: null is returned.

qgustavor avatar Oct 08 '18 14:10 qgustavor

@qgustavor Not sure if it was fixed, but currently am getting data back with that given request.

screen shot 2018-10-27 at 9 06 28 am

Are you still getting null returned?

alex-mac avatar Oct 27 '18 16:10 alex-mac

I added this anime to my list so it will not return 404 anymore. Try again with a random id like 1000, 1234, 1639 or 2406. I just tried again with 2406 and it returned this:

{
  "data": {"MediaList": null, "Media": null},
  "errors": [{
    "message": "Not Found.", "status": 404, "locations": [{"line": 3, "column": 3}]
  }]
}

qgustavor avatar Oct 27 '18 17:10 qgustavor

Was able to recreate! I agree with your intended solution

alex-mac avatar Oct 28 '18 05:10 alex-mac

I've run into this issue as well. It's especially problematic when requesting a large number of items at once (50), and if any one of them is not found the entire batch fails.

Bottersnike avatar Mar 28 '20 16:03 Bottersnike

I have encountered this problem as well, has anyone been able to find a solution?

3174N avatar Jul 18 '21 18:07 3174N