-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Avoid duplicate cacheControl
directives via isDirectiveDefined
#2428
Conversation
Thanks for working on this! |
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
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 |
Also added the MISSING `CHANGELOG.md` from the original release which I somehow stomped out! Ref: #2428
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 PR adds a utility function
isDirectiveDefined
and uses it to guard against duplicate directives when the user's schema already contains a directive (in this case, cacheControl)TODO: