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
|`name`| Set custom name of mutation or query (instead of based on class) |
69
+
|`description`| Set description of the mutation or query, readable in the GraphQL schema |
70
+
|`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))`) |
70
71
71
-
## InputType
72
+
###InputType
72
73
73
74
Input types can be defined with `#[InputType]`.
74
75
In order to configure your class as input type, just add this attribute on class level:
@@ -93,7 +94,7 @@ final readonly class YourInputType
93
94
}
94
95
```
95
96
96
-
### Automatic schema creation
97
+
####Automatic schema creation
97
98
98
99
*GraphQL Attribute Schema* will read the `__construct` signature: input arguments.
99
100
Any input argument with a defined `#[Field]` will be automatically configured in the schema (this can be overwritten,
@@ -105,7 +106,7 @@ When using objects, make sure these are defined as well with `#[InputType]` or `
105
106
Also, the name of the input type will be automatically read from the class name (this can be overwritten, see
106
107
options).
107
108
108
-
### Options
109
+
####Options
109
110
110
111
`#[InputType]` attribute can be configured:
111
112
@@ -114,7 +115,7 @@ options).
114
115
|`name`| Set custom name of input type (instead of based on class) |
115
116
|`description`| Set description of the input type, readable in the GraphQL schema |
116
117
117
-
## Type
118
+
###Type
118
119
119
120
Types can be defined with `#[Type]`.
120
121
In order to configure your class as type, just add this attribute on class level:
@@ -145,7 +146,7 @@ final readonly class YourType
145
146
}
146
147
```
147
148
148
-
### Automatic schema creation
149
+
####Automatic schema creation
149
150
150
151
*GraphQL Attribute Schema* will both read the `__construct` signature: input arguments, as well as read all methods.
151
152
@@ -163,7 +164,7 @@ When using objects, make sure these are defined as well with `#[InputType]` or `
163
164
Also, the name of the type will be automatically read from the class name (this can be overwritten, see
164
165
options).
165
166
166
-
### Options
167
+
####Options
167
168
168
169
`#[Type]` attribute can be configured:
169
170
@@ -172,7 +173,7 @@ options).
172
173
|`name`| Set custom name of type (instead of based on class) |
173
174
|`description`| Set description of the type, readable in the GraphQL schema |
174
175
175
-
## Enum
176
+
###Enum
176
177
177
178
Enums can be defined with `#[Enum]`.
178
179
In order to configure your enum class as enum, just add this attribute on class level:
@@ -191,22 +192,22 @@ enum YourEnumType: string
191
192
}
192
193
```
193
194
194
-
### Automatic schema creation
195
+
####Automatic schema creation
195
196
196
197
*GraphQL Attribute Schema* will read the enum signature.
197
198
198
199
The values for the enum will be automatically read from the PHP `enum`; it uses the string version.
199
200
200
201
The name of the enum will be automatically read from the class name (this can be overwritten, see options).
201
202
202
-
### Requirements
203
+
####Requirements
203
204
204
205
Enums:
205
206
206
207
- must be of the PHP native `enum` type (no classes with public constants)
207
208
- The PHP `enum` type must be a `BackedEnum`
208
209
209
-
### Options
210
+
####Options
210
211
211
212
`#[Enum]` attribute can be configured:
212
213
@@ -223,7 +224,7 @@ Each case in the `enum` type can be configured as well, with the `#[EnumValue]`
|`name`| Set custom name of field (instead of based on class) |
279
+
|`description`| Set description of the field, readable in the GraphQL schema |
280
+
|`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))`) |
281
281
282
-
## Arg
282
+
###Arg
283
283
284
284
For `#[Mutation]`, `#[Query]` and `#[Type]` methods defined with `#[Field]`, input arguments are read
285
285
automatically from the signature.
@@ -327,13 +327,12 @@ final readonly class YourType
|`name`| Set custom name of argument (instead of based on class) |
337
+
|`description`| Set description of the argument, readable in the GraphQL schema |
338
+
|`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))`) |
0 commit comments