-
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
Changes from 10 commits
e3078e2
049cb7b
bdb1771
e1db4fe
a629b6a
255c52a
b87d16e
e098c73
824e642
7b94685
aa92d13
d829f0d
b4aa810
2da416c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@apollo/gateway": patch | ||
--- | ||
|
||
Current request graph path exposure | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { ResponsePath } from '@apollo/query-planner'; | ||
import { GatewayGraphQLResponse, GatewayGraphQLRequestContext } from '@apollo/server-gateway-interface'; | ||
|
||
export interface GraphQLDataSource< | ||
|
@@ -21,6 +22,11 @@ export type GraphQLDataSourceProcessOptions< | |
* The request to send to the subgraph. | ||
*/ | ||
request: GatewayGraphQLRequestContext<TContext>['request']; | ||
|
||
/** | ||
* The path to the current processed node within the graph query | ||
*/ | ||
nodeGraphPath?: ResponsePath; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd move this inside the Could be nice to also document that the path may be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the clarifications! I've adopted your guidelines. |
||
} & ( | ||
| { | ||
kind: GraphQLDataSourceRequestKind.INCOMING_OPERATION; | ||
|
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.
It would be awesome to expand this entry a bit. I'd suggest something along the lines of:
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.
Amazing. thanks!