graphql / graphql/graphql.github.io

Feedback for “Schemas and Types”; Why is a "Query" considered a "type"?

オープン
#1,825 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
889
フォーク
1.5k
平均マージ
4日 12時間
マージ済み PR(30日)
21

説明

It is more of a fundamental question in terms of naming some artifacts of a GraphQl system.

Why is a "Query" considered a "type"? It is hard for me to conceptualize the following two declarations in the same specification because their essential nature and semantics are different:

type Character {
name: String!
appearsIn: [Episode!]!
}

type Query {
droid(id: ID!): Droid
}

Character describes the type (composition) of a data object whereas Query is an operation. Conceptually, Query, Mutation, and Subscription are "operations" - not "types".

Why are we overloading the term "type" to specify the "composition of a data object" as well as an "operation"?

Saying the following may be more appropriate if we have to use the term "type":

objectType Character {
name: String!
appearsIn: [Episode!]!
}

operationType Query {
droid(id: ID!): Droid
}

Maybe you can explain it in a way that avoids this conceptual confusion between the "composition of a data object" and an "operation" indicated by the same term "type".

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず「Schemas and Types」のドキュメントと、Query、Mutation、Subscription、object types を扱う GraphQL 仕様のセクションを確認してください。これらの概念がなぜ「type」という用語を共有しているのかを明確に説明できるか、混乱を解消する具体的なドキュメント変更を決定できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

領域
documentation
issue の種類
ドキュメント
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。