-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support code files (js, ts) as schema files #1425
Comments
I noticed this is technically possible, as certain tools do integrate with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I work on a project that defines its GraphQL schema in
gql
tags across a number of.ts
files in the server directory. We generate aschema.graphql
file from those code files in the pre-commit step using graphql-codegen, but during development the most up-to-date information about the schema is in thosegql
tags, not in theschema.graphql
file.Furthermore, in my IDE, clicking through any client-side definitions (e.g. a query name in a query operation) sends me to the generated schema rather than the typescript source, which is what we'd consider the "source of truth". (I recognize this could also be implemented as an IDE feature. I'll make a ticket there as well).
Describe the solution you'd like
Graphql config files should support
js
/ts
files in theschema
field. Consumers can parse the graphql from those files as they choose.Describe alternatives you've considered
The only working alternative now is to search the codebase for the definitions as they appear in Typescript.
Additional context
Some kind of "source map" concept could potentially solve this as well. I wish I could integrate directly with
graphql-codegen
!The text was updated successfully, but these errors were encountered: