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

未关闭
#446 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
25/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
活跃
技术栈
graphql
领域
api

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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 😄

主要语言
JavaScript
星标
428
派生
70
平均合并
11 分钟
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

graphql/graphql-over-http 的其他 Issue

查看 graphql/graphql-over-http 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。