Minify: Add support for deprecated directive#367
Merged
Conversation
Contributor
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 2 changed, 0 removedBuild ID: 462d8d6d1cd4f59f3f55af73 URL: https://www.apollographql.com/docs/deploy-preview/462d8d6d1cd4f59f3f55af73 |
DaleSeo
reviewed
Sep 18, 2025
DaleSeo
reviewed
Sep 18, 2025
Member
There was a problem hiding this comment.
We should update the relevant section in our docs:
https://www.apollographql.com/docs/apollo-mcp-server/define-tools#minification
… arguments if we have that present
50ad170 to
8d83382
Compare
DaleSeo
approved these changes
Sep 23, 2025
DaleSeo
left a comment
Member
There was a problem hiding this comment.
Thanks for addressing my feedback! 🙇
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In #346, it is mentioned that our tools aren't properly picking up
deprecateddirectives when building and executing operations. This led me to dig deeper and find that ourminifyhandling for the builtin tools does not include any directives in the minified output. This can potentially be harmful since it means the LLM doesn't know to exclude certain fields when building operations withintrospect.In this PR, I've added the ability to minify deprecated directives with the inclusion of their
reasonargument to give better direction to the LLM when it works within this problem space.Additionally, I've added some snapshot tests to the
minifyfile so we can assert that the minified schema is built properly and includes the things we expect it to include.I've also made sure to add proper coverage for the directive since it has recently been updated to be allowed to be placed on
INPUT_FIELD_DEFINITIONandARGUMENT_DEF(though these technically fail schema validation with our current graphql-rs parser.