Repository navigation
Detect introspection fields instead of keyword substrings - #323
Open
theman6660 wants to merge 1 commit into
Open
theman6660 wants to merge 1 commit into
theman6660 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
A normal business query such as
{ EchoEntity { echo(text: "__schema") { text } } }is dispatched as introspection instead of invoking echo. String arguments containing __type or __typename similarly produce an empty metadata response. The compose MCP detector also incorrectly rejects these strings.Use a shared GraphQL AST field visitor for both detection paths. Only actual field names trigger introspection; strings, block strings, comments, aliases, variable names, and operation names do not. Keep the cheap negative keyword check and let malformed documents reach the normal query parser.
The tests include actual GraphQLHandler.execute calls, field aliases, fragments, string literals, and malformed input. Before the fix, 13 new cases failed and 6 controls passed; all 19 now pass. With existing compose introspection tests, 52 passed. Full tests excluding the independently confirmed environment-incompatible memory test: 916 passed, 1 skipped, 1 deselected. Ruff and git diff --check passed.
Prepared with OpenAI Codex assistance. No production usage, human review or upstream CI is claimed.