Open smcgivern opened 11 months ago
If a response from the server isn't OK, handleFetchResponse will reject the promise (throwing an error) with the JSON-parsed version of the response: https://github.com/graphql-editor/graphql-zeus/blob/cfd6d58cc4d08131ba80e67c8b098856eca7a83d/packages/graphql-zeus-core/TreeToTS/functions/new/apiFetch.ts#L10
handleFetchResponse
This seems like it would either be better off as a GraphQLError, or a different type. Throwing an object as an error is a bit confusing for callers (see https://github.com/graphql/graphql-js/issues/1393, for example).
If a response from the server isn't OK,
handleFetchResponse
will reject the promise (throwing an error) with the JSON-parsed version of the response: https://github.com/graphql-editor/graphql-zeus/blob/cfd6d58cc4d08131ba80e67c8b098856eca7a83d/packages/graphql-zeus-core/TreeToTS/functions/new/apiFetch.ts#L10This seems like it would either be better off as a GraphQLError, or a different type. Throwing an object as an error is a bit confusing for callers (see https://github.com/graphql/graphql-js/issues/1393, for example).