Configuring the pluginReturning a payload object or the mutated entity for mutations
Returning a payload object or the mutated entity for mutations
We can configure mutation fields to return either of these 2 different entities:
- A payload object type
- Directly the mutated entity
When returning using the payload object type, we can additionally add fields to the schema to query the mutation payload objects.
Overall, we can configure the GraphQL schema with one among three options:
- Use payload types for mutations
- Use payload types for mutations, and add fields to query those payload objects
- Do not use payload types for mutations (i.e. return the mutated entity)
Using payload object types for mutations in the schema can be configured as follows, in order of priority:
✅ Specific mode for the custom endpoint or persisted query, defined in the schema configuration
✅ Default mode, defined in the Settings
If the schema configuration has value "Default"
, it will use the mode defined in the Settings: