reduxjs / redux-toolkit

The official, opinionated, batteries-included toolset for efficient Redux development
https://redux-toolkit.js.org
MIT License
10.64k stars 1.15k forks source link

Type mismatch when passing GraphQLClient instance to @rtk-query/graphql-request-base-query graphqlRequestBaseQuery #2931

Open joemar12 opened 1 year ago

joemar12 commented 1 year ago

There's a type mismatch when passing an instance of GraphQLClient from graphql-request v5 to graphqlRequestBaseQuery. The error looks like this: Type 'import(".../node_modules/graphql-request/dist/index").GraphQLClient' is not assignable to type 'import(".../node_modules/@rtk-query/graphql-request-base-query/node_modules/graphql-request/dist/index").GraphQLClient'. Types have separate declarations of a private property 'url'.

Biggo89 commented 1 year ago

Hello everyone, facing the same issue. Is there any update on this issue?

phryneas commented 1 year ago

You probably have two different versions of graphql-request installed. Use your package manager to narrow it down to only one.

jcfergus commented 1 year ago

The currently-published @rtk-query/graphql-request-base-query has a dependency on graphql-request@4.3.0.
It seems like if you're using npm, forcing an npm install --save graphql-request@4.3.0 will resolve this issue.

donovan-ecargo commented 1 year ago

Would the maintainers be open to a PR updating the version of graphql-request to 6.1.0 in the @rtk-query/graphql-request-base-query package?

markerikson commented 1 year ago

@donovan-ecargo yep!