-
Notifications
You must be signed in to change notification settings - Fork 172
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
Support For Mutations #19
Comments
I was looking to get started on this soon aswell (although soon is whenever i feel like playing around with it). Mutations should probably get their own resolvers, i haven't looked to much at how they are integrated in graphql but i believe they get their own section right? |
@mickhansen we have a solution started on a branch of our fork. It uses two different mutation Resolvers and has a few helper functions. |
+1 for this. Btw... how do we handle (form) validations in that case? |
@xpepermint sequelize validations would still work. And i assume that mutations will be typed so you can atleast ensure correct types and non-null if needed. |
@mickhansen that's good. |
@xpepermint well that's really up to you, the sequelize validation output is a structure containing the rule that failed, on what value, etc. |
I'll run some tests on graphql error messages for validations and let you know what results we get. There is an errors object returned on all GraphQL errors, so hopefully that'll contain some information. if it doesn't by default we could look into integrating the error handling portion more closely with sequelize. |
@brad-decker that's great! |
This debate graphql/graphql-js#179 could help us here. |
Thanks @xpepermint - will definitely use this as resource when we dive more into mutation support. |
We're currently trying to figure out what is the right amount of auto generation when it comes to mutation support. Too much magic and its not clear how things are working and there's too much of an opportunity for random errors. We're also trying to add support for graphql-relay mutations with client ids so that users will have the option to support their own custom mutations or use the mutateAndGetPayload feature of graphql-relay-js mutations |
Would love to see any preliminary api designs you have @brad-decker. |
@mickhansen Thats what we're working our way too. We are still wrapping our minds around how we want to approach. i'll ping you here when we have a draft we're pleased with. |
Btw, I started with this https://github.com/xpepermint/graphql-type-factory. |
@brad-decker Any progress here? Getting started on mutations myself and would love to hear what experiences you might have had - Not sure it makes sense to provide that much help from this library since most mutations have a bit of logic (unless we're talking straight up create association or model instance from supplied values). |
Any update on this? @rpellerin created an awesome lib: https://github.com/rpellerin/graphql-sequelize-schema-generator |
Need to add support for mutations to the resolver, or build a new resolver for mutations. I plan on working on this feature, but if you have any input on the best way to achieve this @mickhansen I'm open to ideas.
The text was updated successfully, but these errors were encountered: