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
-`NullableTypeMapperAdapter`: a type mapper in charge of making GraphQL types non-nullable if the PHP type is non-nullable
61
-
-`CompoundTypeMapper`: a type mapper in charge of union types
62
-
-`IteratorTypeMapper`: a type mapper in charge of iterable types (for instance: `MyIterator|User[]`)
63
-
-`MyCLabsEnumTypeMapper`: maps MyCLabs/enum types to GraphQL enum types
64
-
-`BaseTypeMapper`: maps scalar types and lists. Passes the control to the "recursive type mappers" if an object is encountered.
65
-
-`FinalRootTypeMapper`: the last type mapper of the chain, used to throw error if no other type mapper managed to handle the type.
61
+
-`NullableTypeMapperAdapter`: a type mapper in charge of making GraphQL types non-nullable if the PHP type is non-nullable
62
+
-`IteratorTypeMapper`: a type mapper in charge of iterable types (for instance: `MyIterator|User[]`)
63
+
-`CompoundTypeMapper`: a type mapper in charge of union types
64
+
-`MyCLabsEnumTypeMapper`: maps MyCLabs/enum types to GraphQL enum types (Deprecated: use native enums)
65
+
-`EnumTypeMapper`: maps PHP enums to GraphQL enum types
66
+
-`BaseTypeMapper`: maps scalar types and lists. Passes the control to the "recursive type mappers" if an object is encountered.
67
+
-`FinalRootTypeMapper`: the last type mapper of the chain, used to throw error if no other type mapper managed to handle the type.
66
68
67
69
Type mappers are organized in a chain; each type-mapper is responsible for calling the next type mapper.
68
70
@@ -74,13 +76,13 @@ graph TD;
74
76
CompoundTypeMapper-->IteratorTypeMapper
75
77
IteratorTypeMapper-->YourCustomRootTypeMapper
76
78
YourCustomRootTypeMapper-->MyCLabsEnumTypeMapper
77
-
MyCLabsEnumTypeMapper-->BaseTypeMapper
79
+
MyCLabsEnumTypeMapper-->EnumTypeMapper
80
+
EnumTypeMapper-->BaseTypeMapper
78
81
BaseTypeMapper-->FinalRootTypeMapper
79
82
end
80
83
class YourCustomRootTypeMapper custom;
81
84
```
82
85
83
-
84
86
## Class type mappers
85
87
86
88
(Classes implementing the [`TypeMapperInterface`](https://github.com/thecodingmachine/graphqlite/blob/master/src/Mappers/TypeMapperInterface.php))
@@ -89,9 +91,9 @@ Class type mappers are mapping PHP classes to GraphQL object types.
89
91
90
92
GraphQLite provide 3 default implementations:
91
93
92
-
-`CompositeTypeMapper`: a type mapper that delegates mapping to other type mappers using the Composite Design Pattern.
93
-
-`GlobTypeMapper`: scans classes in a directory for the `@Type` or `@ExtendType` annotation and maps those to GraphQL types
94
-
-`PorpaginasTypeMapper`: maps and class implementing the Porpaginas `Result` interface to a [special paginated type](pagination.mdx).
94
+
-`CompositeTypeMapper`: a type mapper that delegates mapping to other type mappers using the Composite Design Pattern.
95
+
-`GlobTypeMapper`: scans classes in a directory for the `@Type` or `@ExtendType` annotation and maps those to GraphQL types
96
+
-`PorpaginasTypeMapper`: maps and class implementing the Porpaginas `Result` interface to a [special paginated type](pagination.mdx).
95
97
96
98
### Registering a type mapper in Symfony
97
99
@@ -135,5 +137,6 @@ that implements the [`ParameterMiddlewareInterface`](https://github.com/thecodin
135
137
You can register your own parameter middlewares using the `SchemaFactory::addParameterMiddleware()` method, or by tagging the
136
138
service as "graphql.parameter_middleware" if you are using the Symfony bundle.
137
139
138
-
<divclass="alert alert--info">Use a parameter middleware if you want to inject an argument in a method and if this argument
139
-
is not a GraphQL input type or if you want to alter the way input types are imported (for instance if you want to add a validation step)</div>
140
+
<divclass="alert alert--info">
141
+
Use a parameter middleware if you want to inject an argument in a method and if this argument is not a GraphQL input type or if you want to alter the way input types are imported (for instance if you want to add a validation step)
0 commit comments