File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ The following attributes can be used:
77- ` #[InputType] `
88- ` #[Type] `
99- ` #[Enum] `
10+ - ` #[EnumValue] `
1011- ` #[Field] `
1112- ` #[Arg] `
1213
@@ -178,12 +179,14 @@ In order to configure your enum class as enum, just add this attribute on class
178179
179180``` php
180181use Jerowork\GraphqlAttributeSchema\Attribute\Enum;
182+ use Jerowork\GraphqlAttributeSchema\Attribute\EnumValue;
181183
182184#[Enum]
183185enum YourEnumType: string
184186{
185187 case Foo = 'FOO';
186188 case Bar = 'BAR';
189+ #[EnumValue(description: 'A description for case Baz')]
187190 case Baz = 'BAZ';
188191}
189192```
@@ -212,6 +215,14 @@ Enums:
212215| ` name ` | Set custom name of enum (instead of based on class) |
213216| ` description ` | Set description of the enum, readable in the GraphQL schema |
214217
218+ Each case in the ` enum ` type can be configured as well, with the ` #[EnumValue] ` attribute on case level.
219+
220+ ` #[EnumValue] ` attribute can be configured:
221+
222+ | Option | Description |
223+ | ---------------| ------------------------------------------------------------------|
224+ | ` description ` | Set description of the enum case, readable in the GraphQL schema |
225+
215226## Field
216227
217228In ` #[Type] ` and ` #[InputType] ` , to define fields, the ` #[Field] ` attribute can be used.
You can’t perform that action at this time.
0 commit comments