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

UrlLoader types should allow passing IntrospectionOptions #9841

Open
meiamsome opened this issue Feb 9, 2024 · 0 comments
Open

UrlLoader types should allow passing IntrospectionOptions #9841

meiamsome opened this issue Feb 9, 2024 · 0 comments

Comments

@meiamsome
Copy link

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

The implementation of the UrlLoader supports passing IntrospectionOptions down to the getIntrospectionOptions function call:

https://github.com/ardatan/graphql-tools/blob/2e1c0b7454d2e37c1a1cde07ce2e6622b2b83582/packages/loaders/url/src/index.ts#L404

https://github.com/ardatan/graphql-tools/blob/2e1c0b7454d2e37c1a1cde07ce2e6622b2b83582/packages/wrap/src/introspect.ts#L70

E.g. you can write a config like this:

    schema: {
        '<schemaurl>': {
            inputValueDeprecation: true,
        },
    },

And it will pass inputValueDepecation down correctly and support the inputValueDeprecation feature.

However, the TypeScript types do not accept this as an option:

export interface UrlSchemaOptions {
/**
* @description HTTP headers you wish to add to the HTTP request sent by codegen to fetch your GraphQL remote schema.
*/
headers?: { [headerName: string]: string };
/**
* @description Specify a Node module name, or a custom file, to be used instead of standard `fetch`
*/
customFetch?: string;
/**
* @description HTTP Method to use, either POST (default) or GET.
*/
method?: string;
/**
* @description Handling the response as SDL will allow you to load schema from remote server that doesn't return a JSON introspection.
*/
handleAsSDL?: boolean;
}

Describe the solution you'd like

Should this type extend LoadFromUrlOptions or IntrospectionOptions perhaps?

Describe alternatives you've considered

No response

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

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