You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has modified the ``GraphQLFieldDefinition`` so that its original data fetcher will ONLY be called if the current authorisation context
115
-
has the ``manager`` role. Exactly what mechanisms you use for authorisation is up to you. You could use Spring Security for example say, graphql-java doesn't
116
-
really care.
112
+
has the ``manager`` role. You can use any mechanism for authorisation, for example Spring Security or anything else.
117
113
118
-
You would provide this authorisation checker into the execution "context" object of the graphql input so it can then be accessed later in the
114
+
You would provide this authorisation checker into the execution "context" object of the graphql input, so it can then be accessed later in the
In order to use a directive in SDL, the graphql specification requires that you MUST declare its shape before using it. Our ``@auth`` directive example above needs to be
128
+
In order to use a directive in SDL, the graphql specification requires that you MUST declare its shape before using it. Our ``@auth`` directive example above needs to be
133
129
declared like so before use.
134
130
135
131
```graphql
@@ -144,13 +140,13 @@ type Employee
144
140
}
145
141
```
146
142
147
-
The one exception to this is the ``@deprecated`` directive which is implicitly declared for you as follows:
143
+
The one exception to this is the ``@deprecated`` directive which is implicitly declared for you as follows:
148
144
149
145
```graphql
150
146
directive@deprecated(reason: String = "No longer supported") onFIELD_DEFINITION | ENUM_VALUE
151
147
```
152
148
153
-
ThevalidSDLdirectivelocationsareasfollows:
149
+
ThevalidSDLdirectivelocationsareasfollows:
154
150
155
151
```graphql
156
152
SCHEMA,
@@ -170,11 +166,11 @@ Directives are commonly applied to fields definitions but as you can see there a
170
166
171
167
## Another Example - Date Formatting
172
168
173
-
Date formatting is a crosscutting concern that we should only have to write once and apply it in many areas.
169
+
Date formatting is a cross-cutting concern that we should only have to write once and apply it in many areas.
174
170
175
171
The following demonstrates an example schema directive that can apply date formatting to fields that are ``LocaleDate`` objects.
176
172
177
-
Whats great in this example is that it adds an extra ``format`` argument to each field that it is applied to. So the clients can
173
+
What's great in this example is that it adds an extra ``format`` argument to each field that it is applied to. So the clients can
178
174
opt into what ever date formatting you provide per request.
179
175
180
176
```graphql
@@ -275,13 +271,13 @@ public static void main(String[] args) {
275
271
Notice the SDL definition did not have a ``format`` argument yet once the directive wiring is applied, it is added
276
272
to the field definition and hence clients can begin to use it.
277
273
278
-
Please note that graphql-java does not ship with this implementation. It is merely provided here as
274
+
Please note that graphql-java does not ship with this implementation. It is merely provided here as
279
275
an example of what you could add yourself.
280
276
281
277
282
278
## Chaining Behaviour
283
279
284
-
The directives are applied in the order they are encountered. For example imagine directives that changed the case of a field value.
280
+
The directives are applied in the order they are encountered. For example imagine directives that changed the case of a field value.
This has modified the ``GraphQLFieldDefinition`` so that its original data fetcher will ONLY be called if the current authorisation context
115
-
has the ``manager`` role. Exactly what mechanisms you use for authorisation is up to you. You could use Spring Security for example say, graphql-java doesn't
116
-
really care.
112
+
has the ``manager`` role. You can use any mechanism for authorisation, for example Spring Security or anything else.
117
113
118
-
You would provide this authorisation checker into the execution "context" object of the graphql input so it can then be accessed later in the
114
+
You would provide this authorisation checker into the execution "context" object of the graphql input, so it can then be accessed later in the
In order to use a directive in SDL, the graphql specification requires that you MUST declare its shape before using it. Our ``@auth`` directive example above needs to be
128
+
In order to use a directive in SDL, the graphql specification requires that you MUST declare its shape before using it. Our ``@auth`` directive example above needs to be
133
129
declared like so before use.
134
130
135
131
```graphql
@@ -144,13 +140,13 @@ type Employee
144
140
}
145
141
```
146
142
147
-
The one exception to this is the ``@deprecated`` directive which is implicitly declared for you as follows:
143
+
The one exception to this is the ``@deprecated`` directive which is implicitly declared for you as follows:
148
144
149
145
```graphql
150
146
directive@deprecated(reason: String = "No longer supported") onFIELD_DEFINITION | ENUM_VALUE
151
147
```
152
148
153
-
ThevalidSDLdirectivelocationsareasfollows:
149
+
ThevalidSDLdirectivelocationsareasfollows:
154
150
155
151
```graphql
156
152
SCHEMA,
@@ -170,11 +166,11 @@ Directives are commonly applied to fields definitions but as you can see there a
170
166
171
167
## Another Example - Date Formatting
172
168
173
-
Date formatting is a crosscutting concern that we should only have to write once and apply it in many areas.
169
+
Date formatting is a cross-cutting concern that we should only have to write once and apply it in many areas.
174
170
175
171
The following demonstrates an example schema directive that can apply date formatting to fields that are ``LocaleDate`` objects.
176
172
177
-
Whats great in this example is that it adds an extra ``format`` argument to each field that it is applied to. So the clients can
173
+
What's great in this example is that it adds an extra ``format`` argument to each field that it is applied to. So the clients can
178
174
opt into what ever date formatting you provide per request.
179
175
180
176
```graphql
@@ -275,13 +271,13 @@ public static void main(String[] args) {
275
271
Notice the SDL definition did not have a ``format`` argument yet once the directive wiring is applied, it is added
276
272
to the field definition and hence clients can begin to use it.
277
273
278
-
Please note that graphql-java does not ship with this implementation. It is merely provided here as
274
+
Please note that graphql-java does not ship with this implementation. It is merely provided here as
279
275
an example of what you could add yourself.
280
276
281
277
282
278
## Chaining Behaviour
283
279
284
-
The directives are applied in the order they are encountered. For example imagine directives that changed the case of a field value.
280
+
The directives are applied in the order they are encountered. For example imagine directives that changed the case of a field value.
0 commit comments