-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 client awareness support #4154
Conversation
To assist with Engine's client awareness features, these changes allow `name` and `version` params to be passed into the `ApolloClient` constructor. These properties are then passed along via the defined `Link` chain, within the operation `context` made available to each `Link`. Any `Link` interested in using these values can pull them from the `context.clientAwareness` object.
…lographql/apollo-client into hwillson/add-client-headers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added notes on docs. There's a test for the logic and it seems like it works, but I'm not knowledgable enough about the surrounding context to give this a 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super awesome @hwillson! Thank you for putting this together. I left a couple of suggestions on the documentation in case that makes things a bit more clear. I wasn't quite sure what it meant to represent connections
and felt we could be a bit more specific about the mechanics of name and version
❤️ the testing
Co-Authored-By: hwillson <hugh@octonary.com>
Co-Authored-By: hwillson <hugh@octonary.com>
Co-Authored-By: hwillson <hugh@octonary.com>
Co-Authored-By: hwillson <hugh@octonary.com>
This PR updates the
ApolloClient
constructor to acceptname
andversion
params, that can be used to support Apollo Server Client Awareness functionality. These client awareness properties are passed into the defined Apollo Link chain, and are then ultimately sent out as custom headers with outgoing requests.Associated Apollo Link PR: apollographql/apollo-link#872