Closed madshall closed 3 months ago
Visit the deploys page to approve it
Name | Link |
---|---|
Latest commit | 72a7302dd4a5bef1a9c7bb4fdaf39df1da5c9d77 |
No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged
@madshall Thanks for working on this 🙇 Also I've noted a colon at the end of the last property of an object which wasn't there before. Maybe run an prettier before? It will probably affect other files - up to you if you want to commit those too.
In regards to the docs, I think you should go ahead and update that as well. Appreciate it.
The code looks good to me so far. Thank you!
@floridemai I've created the issue to reference here, updated the docs and removed the extra colons. Thank you!
Hi @simoneb, when can this be published to npm?
Done
What does this PR do?
This PR adds
headers
to client response. So along with data, graphQLErrors, httpErrors etc there will be responseheaders
as well. Sometimes response headers contain useful info that the client might need to access. Currently the only way to access them is fromresponseReducer
because it gets passed the entire response beforegenerateResult
is called on it. That doesn't scale well because it needs to be set on every single query which leads to repetitive code and lack of unification. One of the use cases for when the response headers are needed is logging middleware:trace-id
header which can be used in splunk to track down the entire chain of calls to different microservices initiated by the originating client callLet me know if you want me to update the documentation. Didn't do that initially because some teams prefer to do it themselves.
Related issues
https://github.com/nearform/graphql-hooks/issues/1192
Checklist