Avoid duplicate cacheControl directives via isDirectiveDefined#2428
Merged
abernix merged 5 commits intorelease-2.6.0from May 22, 2019
Merged
Avoid duplicate cacheControl directives via isDirectiveDefined#2428abernix merged 5 commits intorelease-2.6.0from
cacheControl directives via isDirectiveDefined#2428abernix merged 5 commits intorelease-2.6.0from
Conversation
|
Thanks for working on this! |
Member
|
I also think the text of the cache control directive should be exported by apollo-cache-control |
|
Any chance this will be merged anytime soon? |
This is me being nitty but this helps me understand the department that the import comes from rather than the globby export-catch-all that is the `main` module. :)
f4ab679 to
6015761
Compare
6015761 to
ab282e2
Compare
This is just for stability. I know we don't do it everywhere right now, but we should! This also removes the extra function, but I don't think we're really getting too much from that now, or later. The constant comparison should be the ideal way of doing this, and TypeScript should be able to do the type narrowing on its own.
ab282e2 to
6ac98dc
Compare
abernix
approved these changes
May 22, 2019
cacheControl directives via isDirectiveDefined
|
I didn't realize that I could generate my own schema and get around this, you might want to add something in the documentation |
abernix
added a commit
that referenced
this pull request
May 31, 2019
Also added the MISSING `CHANGELOG.md` from the original release which I somehow stomped out! Ref: #2428
Member
|
This caused the regression in #2753, which is best explained in the body of #2754, which contains its reversion. @cheapsteak Not sure if you'll have the opportunity to revisit, but just letting you know! (Also as noted above, passing your own schema is a work-around, so potentially less urgent!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a utility function
isDirectiveDefinedand uses it to guard against duplicate directives when the user's schema already contains a directive (in this case, cacheControl)TODO: