GraphQL customization¶
Custom schema¶
You can customize the GraphQL schema that is generated from your repository.
You can use it if your application requires custom GraphQL resources, for instance for Doctrine entities.
To do so, create an config/graphql/Query.types.yaml
file.
The file will be used as the GraphQL query root.
In that file, add new fields that use any custom type or custom logic you require, based on overblog/GraphQLBundle.
Configuration¶
You can include the Ibexa DXP schema in two ways: either through inheritance or composition.
Inheritance¶
To use inheritance, apply the following configuration in config/graphql/Query.types.yaml
:
1 2 3 4 5 6 7 8 |
|
Composition¶
To use composition, define Ibexa DXP schema as a field in your custom schema.
For example, in config/graphql/Query.types.yaml
:
1 2 3 4 5 6 7 8 |
|
Custom mutations¶
Custom mutations are created in the same way as custom query configuration.
A config/graphql/Mutation.types.yaml
file will be used as the source for mutation definitions in your schema.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Custom field name¶
You can customize the name used by GraphQL as the content field name.
Use this setting to avoid conflicts with Field names that derive from a Content Type definition.
1 2 3 |
|