What is the difference between DocumentNode
vs Schema
vs TypeDefs
?
#5713
-
What is the difference between |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
A A
Hope that helped and didn't confuse you even more. 😁 Scott |
Beta Was this translation helpful? Give feedback.
-
There are three types that can represent a GraphQL schema:
(Also note that GraphQL language strings and
|
Beta Was this translation helpful? Give feedback.
There are three types that can represent a GraphQL schema:
string
written in the GraphQL language, often called SDL, liketype Query { field: ID! }
.DocumentNode
, because the top level of GraphQL syntax is calledDocument
. You can get this from thegraphql-js
parse
function or thegraphql-tag
/apollo-server
gql
function (which is a memoizing version ofparse
).GraphQLSchema
object, which represents the schema more directly than as a parsed syntax tree. For example, this object contains a map from type name to objects representing that type (but doesn't have the concept of "o…