You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it is not possible to embed descriptions in the graphql files. This is bad. We should be able to write docs inline with the type declarations.
This actually requires changes to graphql-core. A similar change was made to graphql-js here graphql/graphql-js@165b9d3 . This should be mimicked in graphql-core. The idea to make comments a lexed token, make the stream of lexed tokens a doubly linked list that skips those comments by default. This allows another piece of code to consume the linked list but "peek" backwards to see if there is a comment. If there is, we can see consume that token and produce descriptions as appropriate.
Seems like the best first stab would be to indicate description versus comments by prefixing "##" for descriptions.
# this is a comment that will not appear in the description
## This is a description of User
type User {
# this is not a description
id: UUID!
## This is a description of name
name: String!
## Description of TodoList
todoLists(
## This is a description of first
first: Int = 100,
## This is a description of after
after: UUID): [TodoList!]!
}
The text was updated successfully, but these errors were encountered:
Right now it is not possible to embed descriptions in the graphql files. This is bad. We should be able to write docs inline with the type declarations.
This actually requires changes to graphql-core. A similar change was made to graphql-js here graphql/graphql-js@165b9d3 . This should be mimicked in graphql-core. The idea to make comments a lexed token, make the stream of lexed tokens a doubly linked list that skips those comments by default. This allows another piece of code to consume the linked list but "peek" backwards to see if there is a comment. If there is, we can see consume that token and produce descriptions as appropriate.
Seems like the best first stab would be to indicate description versus comments by prefixing "##" for descriptions.
The text was updated successfully, but these errors were encountered: