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
Copy file name to clipboardExpand all lines: docs/annotations/annotations-reference.md
+39-10Lines changed: 39 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ class Coordinates {
55
55
56
56
@Field
57
57
58
-
@FieldBuilder
58
+
@FieldsBuilder
59
59
60
60
@Input
61
61
@@ -232,7 +232,7 @@ class Planet
232
232
```
233
233
234
234
In the example above, if a query or mutation has this Enum as an argument, the value will be an instanceof the class with the enum value as the `value` property. (see [The Arguments Transformer documentation](arguments-transformer.md)).
235
-
As the class can be instanciated from the `Arguments Transformer` service, it cannot have a constructor with required arguments.
235
+
As the class can be instanciated from the `Arguments Transformer` service, it cannot have a constructor with required arguments.
236
236
237
237
## @EnumValue
238
238
@@ -252,10 +252,12 @@ Optional attributes:
252
252
This annotation can be defined on a _property_ or a _method_.
253
253
254
254
If it is defined on a _method_:
255
-
- If no `resolve` attribute is define, it will default to `@=value.methodName(...args)"`, so the method itself will be used as the field resolver. You can then specify a `name` for this field (or it's the method name that will be use).
255
+
256
+
- If no `resolve` attribute is define, it will default to `@=value.methodName(...args)"`, so the method itself will be used as the field resolver. You can then specify a `name` for this field (or it's the method name that will be use).
256
257
257
258
If it is defined on a _method_ of the Root Query or the Root mutation :
258
-
- If not `resolve` attribute is define, it will default to `@=service(FQN).methodName(...args)"` with `FQN` being the fully qualified name of the Root Query class or Root Mutation.
259
+
260
+
- If not `resolve` attribute is define, it will default to `@=service(FQN).methodName(...args)"` with `FQN` being the fully qualified name of the Root Query class or Root Mutation.
259
261
260
262
Optional attributes:
261
263
@@ -315,6 +317,33 @@ class Hero {
315
317
?>
316
318
```
317
319
320
+
## @FieldsBuilder
321
+
322
+
This annotation is used on the attributes `builders` of a `@Type` annotation.
323
+
It is used to add fields builder to types (see [Fields builders](../definitions/builders/fields.md)))
324
+
325
+
Required attributes:
326
+
327
+
-**builder** : The name of the fields builder
328
+
329
+
Optional attributes:
330
+
331
+
-**builderConfig** : The configuration to pass to the fields builder
This annotation is used on a _class_ to define an input type.
@@ -357,7 +386,7 @@ class SecretArea {
357
386
358
387
This annotation applies on methods for classes tagged with the `@Provider` annotation. It indicates that on this class a method will resolve a Mutation field.
359
388
The resulting field is added to the main Mutation type (define in configuration at key `overblog_graphql.definitions.schema.mutation`).
360
-
The class exposing the mutation(s) must have a corresponding service with his className.
389
+
The class exposing the mutation(s) must have a corresponding service with his className.
361
390
362
391
Example:
363
392
@@ -393,7 +422,7 @@ class MutationProvider {
393
422
## @Provider
394
423
395
424
This annotation applies on classes to indicate that it containts methods tagged with `@Query`o or `@Mutation`.
396
-
Without it, the `@Query` and `@Mutation` are ignored. When used, __remember to have a corresponding service with the fully qualified name of the class as service id__.
425
+
Without it, the `@Query` and `@Mutation` are ignored. When used, **remember to have a corresponding service with the fully qualified name of the class as service id**.
397
426
398
427
Optional attributes:
399
428
@@ -403,7 +432,7 @@ Optional attributes:
403
432
404
433
This annotation applies on methods for classes tagged with the `@Provider` annotation. It indicates that on this class a method will resolve a Query field.
405
434
The resulting field is added to the main Mutation type (define in configuration at key `overblog_graphql.definitions.schema.query`).
406
-
The class exposing the querie(s) must have a corresponding service with his className.
435
+
The class exposing the querie(s) must have a corresponding service with his className.
407
436
408
437
Optional attributes:
409
438
@@ -433,7 +462,6 @@ class UsersProviders {
433
462
?>
434
463
```
435
464
436
-
437
465
## @Type
438
466
439
467
This annotation is used on _class_ to define a GraphQL Type.
@@ -443,12 +471,13 @@ Optional attributes:
443
471
-**name** : The GraphQL name of the type (default to the class name without namespace)
444
472
-**interfaces** : An array of GraphQL interface this type herits from
445
473
-**isRelay** : Set to true to have a Relay compatible type (ie. A `clientMutationId` will be added).
474
+
-**builders**: An array of `@FieldsBuilder` annotations
0 commit comments