Skip to content

Commit 351619a

Browse files
committed
Improved documentation around the class attribute for @type
1 parent 3e01865 commit 351619a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

website/docs/annotations-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ types, as well as enum types. For input types, use the [@Input annotation](#inp
3838

3939
Attribute | Compulsory | Type | Definition
4040
---------------|------------|------|--------
41-
class | *no* | string | The targeted class. If no class is passed, the type applies to the current class. The current class is assumed to be an entity. If the "class" attribute is passed, [the class annotated with `@Type` is a service](external-type-declaration.mdx).
41+
class | *no* | string | The targeted class/enum for the actual type. If no "class" attribute is passed, the type applies to the current class/enum. The current class/enum is assumed to be an entity (not service). If the "class" attribute *is passed*, [the class/enum annotated with `@Type` becomes a service](external-type-declaration.mdx).
4242
name | *no* | string | The name of the GraphQL type generated. If not passed, the name of the class is used. If the class ends with "Type", the "Type" suffix is removed
4343
default | *no* | bool | Defaults to *true*. Whether the targeted PHP class should be mapped by default to this type.
4444
external | *no* | bool | Whether this is an [external type declaration](external-type-declaration.mdx) or not. You usually do not need to use this attribute since this value defaults to true if a "class" attribute is set. This is only useful if you are declaring a type with no PHP class mapping using the "name" attribute.

0 commit comments

Comments
 (0)