Skip to content
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 custom schema loader options #10236

Open
ThePlenkov opened this issue Jan 10, 2025 · 0 comments
Open

Support custom schema loader options #10236

ThePlenkov opened this issue Jan 10, 2025 · 0 comments

Comments

@ThePlenkov
Copy link

ThePlenkov commented Jan 10, 2025

Is your feature request related to a problem? Please describe.

I want to create a custom schema loader, where I first pre-filter and prune schema before generating code files

However currently the only option - is to give a string with the loader name

So what I miss now - is the ability to give custom options, for example array of types to filter or whatever I want.

In the documentation example is recommended to read config from the loader - however i just thought that would be convenient to keep all in one place

Describe the solution you'd like

I'd like to use something like this:

const config: CodegenConfig = {
  overwrite: true,
  schema: {
    "https://gitlab.com/api/graphql": {
      loader: './schema-loader.ts',

      // here we define a custom config
      config: {
          filterQueries: ['project']
       }
    }
  },
...
  }
};

export default config;

Alternatively and is probably even better would be option to give the instance of the loader. In this case we can inititalize it before.

If we have already option to provide the instance for document transformation - why not to introduce something to transform the schema, or at least to load it with a code.

Describe alternatives you've considered

No response

Any additional important details?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant