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/api/graphql/graphql_custom_ft.md
+7-68Lines changed: 7 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,21 +50,17 @@ The `FieldDefinitionMapper` API uses service decorators.
50
50
To register your own mapper, make it decorate the `Ibexa\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper` service:
It's required for every implemented method, so that other mappers are called for the other field types.
88
82
89
-
The [`RelationFieldDefinitionMapper`](https://github.com/ibexa/graphql/blob/main/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php) example:
90
-
91
-
```php hl_lines="14"
92
-
class RelationFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements FieldDefinitionMapper
93
-
{
94
-
public function mapToFieldValueType(FieldDefinition $fieldDefinition): ?string
For an example implementation, look at the [`RelationFieldDefinitionMapper`](https://github.com/ibexa/graphql/blob/main/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/RelationFieldDefinitionMapper.php) class.
135
84
136
85
The value type depends on the field definition allowed content types setting:
137
86
@@ -147,20 +96,10 @@ The cardinality (single or collection) depends on the selection limit setting:
147
96
The `mapToFieldValueInputType` method is used to document what input type is expected by field types that require a more complex input value.
148
97
For example, `ibexa_matrix` generates its own input types depending on the configured columns.
149
98
150
-
Example of a `MyCustomFieldDefinitionMapper` mapper for a complex field type:
99
+
Example of a `MyFieldDefinitionMapper` mapper for a complex field type:
151
100
152
101
```php
153
-
class MyFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements FieldDefinitionMapper
154
-
{
155
-
public function mapToFieldValueInputType(ContentType contentType, FieldDefinition fieldDefinition): ?string
0 commit comments