Clarification about usage of 404 not found in the `application/graphql-response+json` spec

Open
#446 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Active
Tech stack
graphql
Domain
api

Research direction

The payload names no files, so start in the draft specification text and find the section on HTTP status codes for 4xx responses, then read the three existing comments for any decision already reached. Work here means answering whether a missing resource should return 404 or 200 with data: null, and the result is either a maintainer-agreed answer or a proposed wording change to the spec. Expect to need maintainer input before writing anything.

Written by the indexing model from the issue text.

Description

Hey hey,

Not sure if this is the right place to ask, but hopefully someone can still help us out :)

We are currently implementing application/graphql-response+json, which means we should use standard HTTP status codes. We are, however, having a discussion about how to handle cases where the requested data, such as a user, does not exist.

According to this specification, should we return a 404 status code, or should we return a 200 response with "data": null?
We could not find this scenario in the section with all the 4xx status code examples, which made us wonder. ​‌

Thanks in advance 😄

Dominant language
JavaScript
Stars
428
Forks
70
Avg merge
11m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphql/graphql-over-http

All issues in graphql/graphql-over-http

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.