dotansimha / dotansimha/graphql-code-generator-community
global graphql-request client path in fetcher config
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
**Is your feature request related to a problem? Please describe.**
In projects that use GraphQL, it's rare that client sends each request differently depending on the operation. Most of the time, there will be a single instance of the GraphQLClient is created and used throughout the app. Currently the developers are required to pass the same client over and over to the every generated hook they use. Hence, I am suggesting that the generated react query hooks to have preconfigured graphql-request client.
**Describe the solution you'd like**
The easiest solution would be to make the current fetcher config to accept both string and object, and inside the object, user can specify the import path to their GraphQLClient instance.
**Describe alternatives you've considered**
This way it doesn't break the API and give the developers option to use however they like.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.