File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ from being executed by field visibility and access rules.
23
23
Instead a field ` Query.me ` is exposed with no field arguments that invokes ` Query.customer `
24
24
with the customer identifier pulled from the ` sub ` claim in the request's JWT.
25
25
26
- This is implemented using ` @sequence ` with the first step an intermediate field (` Query._myid ` ) that is annotated with ` @value ` using an ECMAScript.
26
+ This is implemented using ` @sequence ` with the first step an intermediate field (` Query._myid ` ) that is annotated with ` @value ` using ECMAScript.
27
27
This script has access to field arguments of its annotated field (in this case none) and JWT claims through ` $jwt ` .
28
28
Thus it returns the ` sub ` claim which is then automatically mapped as a scalar value to the sole argument of
29
29
the next step in the sequence (` Query.customer(id:) ` ).
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ type Customer {
5
5
}
6
6
7
7
type Query {
8
+ """
9
+ Fetch customer by identifier.
10
+ """
8
11
customer (id : ID ! ): Customer
9
12
@dbquery (
10
13
type : " postgresql"
@@ -13,6 +16,10 @@ type Query {
13
16
configuration : " postgresql_config"
14
17
)
15
18
19
+ """
20
+ Fetch my customer information.
21
+ Customer identifier is pulled from the JWT subject claim.
22
+ """
16
23
me : Customer @sequence (steps : [{ query : " _myid" }, { query : " customer" }])
17
24
18
25
"""
You can’t perform that action at this time.
0 commit comments