-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore support for (multiple) transactions and update documentation to provide guidance #274
Comments
This is not implemented because it goes against the specification.
A proposal for something like what you want was launched in December last year: In the meantime you could change your API: type Mutation {
createRoute(routes: [CreateRouteFlightInput!]!): CreateRoutePayload!
}
input CreateRouteFlightInput {
flightNumber: ID!
}
type CreateRoutePayload {
ids: [ID!]!
}
# mutation
mutation multipleMutations {
createRoute(routes: [{flightNumber: "LH2722"}, {flightNumber: "LH2728"}]) {
ids
}
} Lists in GraphQL are ordered. So it becomes an application-level concern that the returned ids are ordered.
You could of course create a custom |
@jord1e Thank you for the explanation, the links to the discussions and the workaround. The topic of mutations and transactions can certainly be discussed in a differentiated manner. And there are some articles about it on the internet. So I would be grateful if we could include a sentence about it in the Spring GraphQL Documentation? For example in chapter 5 Data Integration oder chapter 6 Annotated Controllers. This is just a first suggestion:
After some thought, I also have to say that transaction support at the Spring GraphQL level doesn't make any sense and comes with many questions and problems. I think the transactions need to be resolved via Spring services transactions and repositories transactions depending on the business use case. |
In GraphQL it is possible to execute 1.n mutation.
If I write the data per mutation via a
CrudRepository
, each mutation is transactional on its own. But how can I pack all mutations into a transaction bracket. Is there transaction support via a transactionalExcecutionStrategy
or is there possibly@Transaction
directives support?Perhaps the documentation could be expanded to include a Transaction chapter and describe the current options.
The text was updated successfully, but these errors were encountered: