-
Notifications
You must be signed in to change notification settings - Fork 259
@apollo/gateway - Expose the current request query path to the "willSendRequest" and "didReceiveResponse" hooks #2384
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
Merged
pcmanus
merged 14 commits into
apollographql:main
from
talazenkot:current_request_graph_path_exposure
Feb 21, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e3078e2
expose the resolved node graph path via the request property
talazenkot 049cb7b
expose the resolved node graph path via the request property
talazenkot bdb1771
Merge branch 'current_request_graph_path_exposure' of github.com:tala…
talazenkot e1db4fe
remove redundant attribute
talazenkot a629b6a
Create flat-books-sin.md
talazenkot 255c52a
fix lint issues
talazenkot b87d16e
Merge branch 'current_request_graph_path_exposure' of github.com:tala…
talazenkot e098c73
Merge branch 'main' into current_request_graph_path_exposure
talazenkot 824e642
Merge branch 'main' into current_request_graph_path_exposure
talazenkot 7b94685
Merge branch 'main' into current_request_graph_path_exposure
talazenkot aa92d13
Merge branch 'main' into current_request_graph_path_exposure
talazenkot d829f0d
rename nodeGraphPath to pathInIncomingRequest, improve documentation …
talazenkot b4aa810
fix indentions
talazenkot 2da416c
remove null value & fix documentation
talazenkot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@apollo/gateway": patch | ||
--- | ||
|
||
Exposes, for each subgraph request, the path in the overall gateway operation at which that subgraph request gets inserted. This path is now available as the pathInIncomingRequest field in the arguments of RemoteGraphQLDataSource.willSendRequest and RemoteGraphQLDataSource.didReceiveResponse. |
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need that test (we can use
options.pathInIncomingRequest
directly): it's going to beundefined
for non-INCOMING_OPERATION
, but that feels almost more appropriate, and that avoids having to deal withnull
at all.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the

null
assignment toundefined
, however, I cannot useoptions.pathInIncomingRequest
directly because thepathInIncomingRequest
property is not guaranteed to exist inoptions
because of the usage of typescript's union operator:therefore, I must verify
options.kind
before using it, unless you can think of another approach?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, correct, this is my bad.