I am using AddMutationConventions()
to save me from writing boilerplate code. However I want to add a field query: Query
to each Payload. Is that possible in combination with AddMutationConventions()
or do I have to write my own Payload by hand in that case?
Asked
Active
Viewed 79 times
0

stefan.at.kotlin
- 15,347
- 38
- 147
- 270
-
This should be what you‘re looking for: https://chillicream.com/docs/hotchocolate/v13/defining-a-schema/relay/#query-field-in-mutation-payloads – Tobias Tengler Mar 14 '23 at 21:34
-
awesome, please post as answer :-) – stefan.at.kotlin Mar 14 '23 at 21:54
1 Answers
1
As mentioned in my comment, you can automatically add the query field to all mutation payloads with this configuration option:
services
.AddGraphQLServer()
.AddQueryFieldToMutationPayloads();

Tobias Tengler
- 6,848
- 4
- 20
- 34