[log] log: add debug logging to proxy/graphql_rewrite.go#2378
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
[log] log: add debug logging to proxy/graphql_rewrite.go#2378github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
Add debug logging calls to the GraphQL guard field injection logic using the existing logGraphQL logger from graphql.go. Logging covers: - InjectGuardFields entry with toolName and body size - Early returns (no fields needed, parse error, all fields present) - Injection outcome (no-op vs actual injection) - injectFieldsIntoQuery path taken (fragment vs direct nodes) - No injection point found case Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds debug logging to
internal/proxy/graphql_rewrite.gousing the existinglogGraphQLlogger (defined ingraphql.go, same package). No new logger declaration is needed.Changes
File modified:
internal/proxy/graphql_rewrite.go(1 file, exactly)Logging added
InjectGuardFields— entry + all early-return paths:toolNameandbodyLenfor traceabilityinjectFieldsIntoQuery— injection strategy chosen:fragNameand injected fieldsBefore
InjectGuardFieldshad a single log call only on the success-injection path. Silent failures (parse errors, no-op injections, wrong tool name) were invisible in debug output.After
Every significant control-flow branch emits a debug log, making it straightforward to trace why a guard-field injection did or did not happen for a given request.
Quality checklist
logGraphQLlogger (no duplicate declaration)pkg:filenameconvention (proxy:graphql)