Skip to content
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

Convert some of the big flexible mutations to to smaller specific actions #112

Open
kharann opened this issue Aug 30, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@kharann
Copy link
Collaborator

kharann commented Aug 30, 2021

Some mutations are extremely flexible. However, in GraphQL you can quite simply do multiple mutations at the same time.
Therefore it is possible to split some mutations into a specific one.

Here we use the same votationId input on all the mutations. Non-significant difference in performance because everything is done in the same POST call. We should not create a pure CRUD API, rather specific ones which helps

mutation UpdateVotation($votationId: String!){
   updateVotationInfo(name: String!, description: String!, votId: $votationId){...}
   addAlternativesToVotation(alternative: AlternativeInput!, votationId: $votationId){...}
   updateMeetingSettings(blankVotes: Boolean, threshold: Int!, votationId: $votationId){...}
}

Might be nicer to do compared to have mutations with a lot of Nullable values. The fewer nullable values, the more specific and fault-tolerant the system is.

@kharann kharann added the enhancement New feature or request label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant