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
{{ message }}
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
GraphQL descriptions are a common convention and are part of the GraphQL spec itself. These descriptions make tools like GraphQL Playground even more of a pleasure to use because the free-form descriptions can provide convenient comments on fields/types/queries/etc.
The convenience and context of those descriptions is lost when graphqlgen translates the schema into type definitions. Would it make sense for graphqlgen to preserve the information from schema descriptions in its output type definitions to better align the experience in an IDE with the ease of the Playground?
Additional context
I speak only from experience with VS Code & Atom, but I suspect that all major code editors support JSDoc in the auto-suggestion interface without any configuration (i.e. out of the box). It should be reasonably straightforward to, well, "forward" GraphQL descriptions through to JSDoc comments in the output type definitions, such that the descriptions can be displayed where the type definitions are used.
GraphQL Schema Input:
typeQuery {
""" Returns true 50% of the time; false the other 50%. """randomBoolean: Boolean!
}
Hypothetical graphqlgen Type Definition:
/** * Returns true 50% of the time; false the other 50%. */
randomBoolean: (parent: undefined,args: {},ctx: Context,info: GraphQLResolveInfo)=>Boolean|Promise<Boolean>;
Of course, there are at least a few other places the description annotations could show up in the source schema (above type Query, for instance).
If this feature falls within the scope of graphqlgen, I'd be happy to work on implementing it.
The text was updated successfully, but these errors were encountered:
Description
GraphQL descriptions are a common convention and are part of the GraphQL spec itself. These descriptions make tools like GraphQL Playground even more of a pleasure to use because the free-form descriptions can provide convenient comments on fields/types/queries/etc.
The convenience and context of those descriptions is lost when
graphqlgen
translates the schema into type definitions. Would it make sense forgraphqlgen
to preserve the information from schema descriptions in its output type definitions to better align the experience in an IDE with the ease of the Playground?Additional context
I speak only from experience with VS Code & Atom, but I suspect that all major code editors support JSDoc in the auto-suggestion interface without any configuration (i.e. out of the box). It should be reasonably straightforward to, well, "forward" GraphQL descriptions through to JSDoc comments in the output type definitions, such that the descriptions can be displayed where the type definitions are used.
GraphQL Schema Input:
Hypothetical
graphqlgen
Type Definition:Of course, there are at least a few other places the description annotations could show up in the source schema (above
type Query
, for instance).If this feature falls within the scope of
graphqlgen
, I'd be happy to work on implementing it.The text was updated successfully, but these errors were encountered: