-
Notifications
You must be signed in to change notification settings - Fork 26
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
Allow configuration of @graphql-tools loaders #360
Comments
Hi @GuiHash That's definitively something I have missed when refactoring the schema loaders. Much needed. const schema = await loadSchema(
schemaLocation,
{ loaders: getDocumentLoaders(loaders), },
loaderOptions
); And enhancing the plugin config loaders format to: type className = string; // UrlLoader
type moduleName = string; // "@graphql-tools/url-loader"
+ type moduleOptions = { [option: string]: any };
+ type module = {
+ module: moduleName,
+ options: moduleOptions | undefined
+ }
type loaders = {
- [className: className]: moduleName
+ [className: className]: moduleName | module
} Please go ahead and submit a PR 🚀 |
Released in 1.5.3 |
Hey! I'm sorry to revive this, but I don't really understand the implementation there. It seems all the options passed are moved to an object called {
loaders: [ UrlLoader {} ],
loaderOptions: { headers: { 'x-api-key': 'xxx' } },
filterKinds: [ 'OperationDefinition', 'FragmentDefinition' ],
ignore: [],
cache: {},
cwd: '/home/chris/dev/colony/docs',
sort: true
} Though I think the EDIT: It might be a regression. Here's the original PR which merges the Here's the current code which just passes it in: graphql-markdown/packages/core/src/generator.js Lines 89 to 90 in b828b00
|
Currently, it is not possible to add a configuration to @graphql-tools loaders.
It would be interesting to be able to do it in order to configure url-loader with headers (https://www.graphql-tools.com/docs/schema-loading#url-loader)
If you are interested I can submit a PR, if we agree on how to pass these parameters without creating breaking changes on the configuration of your plugin to load the @graphql-tools loaders
The text was updated successfully, but these errors were encountered: