-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to reference elements further up the call chain as na…
…med parameters (#2988) Query planning and composition work for adding @fromcontext and @context along with bump federation to version 2.8 to accommodate. --------- Co-authored-by: o0Ignition0o <[email protected]> Co-authored-by: Sachin D. Shinde <[email protected]>
- Loading branch information
1 parent
9b7c6ee
commit c4744da
Showing
32 changed files
with
4,283 additions
and
367 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
--- | ||
"@apollo/query-planner": minor | ||
"@apollo/query-graphs": minor | ||
"@apollo/composition": minor | ||
"@apollo/federation-internals": minor | ||
"@apollo/gateway": minor | ||
--- | ||
|
||
Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the `prop` field within the Child resolver. | ||
|
||
```graphql | ||
type Query { | ||
p: Parent! | ||
} | ||
type Parent @key(fields: "id") @context(name: "context") { | ||
id: ID! | ||
child: Child! | ||
prop: String! | ||
} | ||
type Child @key(fields: "id") { | ||
id: ID! | ||
b: String! | ||
field(a: String @fromContext(field: "$context { prop }")): Int! | ||
} | ||
``` |
This file contains 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 |
---|---|---|
|
@@ -182,6 +182,7 @@ referencer | |
relatity | ||
Remaings | ||
Remainings | ||
Renamers | ||
reoptimized | ||
repeateable | ||
reponse | ||
|
Oops, something went wrong.