Open BarryThePenguin opened 2 years ago
Is it possible to add the github loader?
Yes it is possible to add that loader; https://www.graphql-config.com/docs/library/author-extensions#registering-loaders They should add this on their own; https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-server You can create an issue on their repo.
If I do have the schema available locally, how would configure the .graphqlrc.yaml file to download the schema from GitHub, but also point graphql-language-service-server to the local GraphQL schema?
You can have one codegen configuration file that generates schema file then you can have a graphql config file for language server.
Is your feature request related to a problem? Please describe.
I use the
graphql-codegen
cli to generate TypeScript types, etc, for my GraphQL schema.graphql-codegen
is able to load the schema from GitHub using@graphql-tools/github-loader
.https://github.com/dotansimha/graphql-code-generator/blob/92fdaf4c518cc321fe51d98b82181592f61db485/packages/graphql-codegen-cli/src/graphql-config.ts#L18
I've defined the schema in my
.graphqlrc.yaml
file to load the schema from GitHub using the following configThis works great, and I'm able to generate what I need..
I'm also using the VSCode GraphQL Extension, which in turn uses the
graphql-language-service-server
, which in turn usesgraphql-config
to load my.graphqlrc.yaml
file.However, it doesn't look like it's able to load the schema as I've defined it in my config. Instead I see the following message in the output for the GraphQL Language Server..
Describe the solution you'd like
Looking at how
graphql-config
loads the schema, it doesn't appear to have@graphql-tools/github-loader
defined as a loader?https://github.com/kamilkisiela/graphql-config/blob/6c935dbabd8959bd1c863c683c5336d92aaef4b3/src/extension.ts#L30-L42
Is it possible to add the github loader?
Describe alternatives you've considered
I briefly looked into using something like https://www.graphql-inspector.com to download the schema, and make it available locally, but I'm already using the Schema AST plugin for
graphql-codegen
, which I think is more suited for that task..If I do have the schema available locally, how would configure the
.graphqlrc.yaml
file to download the schema from GitHub, but also pointgraphql-language-service-server
to the local GraphQL schema?