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

Support clientAwareness being undefined in Apollo Link context #212

Merged
merged 1 commit into from Jul 28, 2020

Conversation

danielrearden
Copy link
Contributor

Just a small tweak that ensures createUploadLink doesn't break if clientAwareness is undefined. clientAwareness will always be defined when using a link through an ApolloClient instance, but may be undefined in other contexts (like if calling execute directly instead), so we shouldn't assume it will always be defined.

@jaydenseric
Copy link
Owner

jaydenseric commented Jul 28, 2020

Thanks for the PR! I did have it that way originally, but then the when adding code coverage realized it was never necessary when used with Apollo Client. I did try to research instances where it may be undefined in context, but couldn't find any examples so I removed the default.

Copy link
Owner

@jaydenseric jaydenseric left a comment

Choose a reason for hiding this comment

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

Could you please add a test for this, so we can get back to 100% code coverage? Also, we need to add a changelog entry under "Patch".

@danielrearden
Copy link
Contributor Author

@jaydenseric All set :)

test/public/createUploadLink.test.js Outdated Show resolved Hide resolved
test/public/createUploadLink.test.js Show resolved Hide resolved
changelog.md Outdated Show resolved Hide resolved
test/public/createUploadLink.test.js Outdated Show resolved Hide resolved
Copy link
Owner

@jaydenseric jaydenseric left a comment

Choose a reason for hiding this comment

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

🙌

@jaydenseric jaydenseric changed the title Add default value for clientAwareness Support clientAwareness being undefined in Apollo Link context Jul 28, 2020
@jaydenseric jaydenseric merged commit 8cb3507 into jaydenseric:master Jul 28, 2020
@jaydenseric
Copy link
Owner

This change has been published in v14.1.1 🚀

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