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

Add the headers object to the rawRequest's result #76

Merged
merged 2 commits into from
Apr 27, 2018

Conversation

happydenn
Copy link

Fixes #72

@@ -32,12 +32,12 @@ export class GraphQLClient {
const result = await getResult(response)

if (response.ok && !result.errors && result.data) {
return result
return { ...result, headers: response.headers }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't there be a clash if result contains a field called headers?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is a good point. Should we use a prefix like underscore with a special name or are there any other suggestions? For example: _headers, _responseHeaders?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think it should be fine actually given that the GraphQL spec currently just allows for data, errors and extensions to be returned.

@schickling schickling merged commit d365229 into jasonkuhrt:master Apr 27, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants