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

Loosen typescript-react-apollo defaultBaseOptions type #463

Closed
namoscato opened this issue Oct 21, 2023 · 0 comments
Closed

Loosen typescript-react-apollo defaultBaseOptions type #463

namoscato opened this issue Oct 21, 2023 · 0 comments

Comments

@namoscato
Copy link
Contributor

Which packages are impacted by your issue?

@graphql-codegen/typescript-react-apollo

Describe the bug

TypeScript React Apollo's defaultBaseOptions object values are currently restricted to string:

defaultBaseOptions?: { [key: string]: string };

but they can be any number of data types.

Your Example Website or App

n/a

Steps to Reproduce the Bug or Issue

  1. try configuring an option with a non-string data type, i.e. ignoreResults:

    const config = {
        // ...
        defaultBaseOptions: {
            ignoreResults: true,
        }
    }
  2. see TypeScript error:

    Type 'boolean' is not assignable to type 'string'.
    

Expected behavior

The object value should just be typed any:

{ [key: string]: any }

Screenshots or Videos

No response

Platform

  • @graphql-codegen/typescript-react-apollo version: 4.0.0

Codegen Config File

No response

Additional context

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