dotansimha / dotansimha/graphql-code-generator-community

[React Query] option to allow responses with both { data: TData, errors?: Array<TError> }

Open
#129 6 comments 8 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
137
Forks
195
Avg merge
6h 20m
Merged PRs (30d)
16

Description

Loving the react-query codegen plugin, thank you very much!

As we know, graphql returns `{ data, errors }` -- the custom fetcher seems to force us to resolve *just* data or throw *just* errors, but we could have some successful data, and maybe one field resolver error.

Is it possible for this to be an option so we can see successful data as well as errors? I only throw if `!!errors && data === null` , or maybe i never even want to throw if its a 200 from graphql (aside from bad input, invalid auth, timeout, etc.)

Or is it even possible for the generated code to determine the return types from the custom fetcher?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.