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/usage.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,18 @@ At minimum, a query and mutation needs to be defined to build a valid schema.
6
6
7
7
The following attributes can be used:
8
8
9
-
-`#[Mutation]`
10
-
-`#[Query]`
11
-
-`#[InputType]`
12
-
-`#[Type]`
13
-
-`#[Enum]`
14
-
-`#[EnumValue]`
15
-
-`#[Field]`
16
-
-`#[Arg]`
9
+
-[#[Mutation]](#mutation-and-query)
10
+
-[#[Query]](#mutation-and-query)
11
+
-[#[Type]](#type)
12
+
-[#[InputType]](#inputtype)
13
+
-[#[Enum]](#enum)
14
+
-[#[EnumValue]](#enum)
15
+
-[#[Field]](#field)
16
+
-[#[Arg]](#arg)
17
17
18
18
See below for more information about each attribute:
19
19
20
-
### Mutation and query
20
+
### #[Mutation] and #[Query]
21
21
22
22
Mutations and queries can be defined with `#[Mutation]` and `#[Query]`. In order to configure your class as mutation or
23
23
query, just add these attributes on class level:
@@ -72,7 +72,7 @@ Both `#[Mutation]` and `#[Query]` attribute can be configured:
72
72
|`type`| Set custom return type; it can be:<br/>- A Type (FQCN)<br/>- A `ScalarType` (e.g. `ScalarType::Int`)<br/>- A `ListType` (e.g. `new ListType(ScalarType::Int)`)<br/>- A `NullableType` (e.g. `new NullableType(SomeType::class)`)<br/>- A combination of `ListType` and `NullableType` and a Type FQCN or `ScalarType` <br/>(e.g. `new NullableType(new ListType(ScalarType::String))`) |
73
73
|`deprecationReason`| If set, deprecates the mutation or query ||
74
74
75
-
### InputType
75
+
### #[InputType]
76
76
77
77
Input types can be defined with `#[InputType]`.
78
78
In order to configure your class as input type, just add this attribute on class level:
@@ -118,7 +118,7 @@ options).
118
118
|`name`| Set custom name of input type (instead of based on class) |
119
119
|`description`| Set description of the input type, readable in the GraphQL schema |
120
120
121
-
### Type
121
+
### #[Type]
122
122
123
123
Types can be defined with `#[Type]`.
124
124
In order to configure your class as type, just add this attribute on class level:
@@ -176,7 +176,7 @@ options).
176
176
|`name`| Set custom name of type (instead of based on class) |
177
177
|`description`| Set description of the type, readable in the GraphQL schema |
178
178
179
-
### Enum
179
+
### #[Enum]
180
180
181
181
Enums can be defined with `#[Enum]`.
182
182
In order to configure your enum class as enum, just add this attribute on class level:
@@ -228,7 +228,7 @@ Each case in the `enum` type can be configured as well, with the `#[EnumValue]`
228
228
|`description`| Set description of the enum case, readable in the GraphQL schema |
229
229
|`deprecationReason`| If set, deprecates the case ||
230
230
231
-
### Field
231
+
### #[Field]
232
232
233
233
In `#[Type]` and `#[InputType]`, to define fields, the `#[Field]` attribute can be used.
234
234
In order to configure any fields this can be set on constructor property (for `#[InputType]` or `#[Type]`) or
@@ -284,7 +284,7 @@ final readonly class YourInputType
284
284
|`type`| Set custom return type; it can be:<br/>- A Type (FQCN)<br/>- A `ScalarType` (e.g. `ScalarType::Int`)<br/>- A `ListType` (e.g. `new ListType(ScalarType::Int)`)<br/>- A `NullableType` (e.g. `new NullableType(SomeType::class)`)<br/>- A combination of `ListType` and `NullableType` and a Type FQCN or `ScalarType` <br/>(e.g. `new NullableType(new ListType(ScalarType::String))`) |
285
285
|`deprecationReason`| If set, deprecates the field (`#[Type]` only) ||
286
286
287
-
### Arg
287
+
### #[Arg]
288
288
289
289
For `#[Mutation]`, `#[Query]` and `#[Type]` methods defined with `#[Field]`, input arguments are read
0 commit comments