-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add mutations to Recipes GraphQL server #23335
Conversation
Would it be sensible to update the current test for this file or add more tests? The current test seems a bit sparse. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💥 meta-programming baby!
Nice work!
@@ -2,6 +2,7 @@ const Joi2GQL = require(`./joi-to-graphql`) | |||
const Joi = require(`@hapi/joi`) | |||
const { GraphQLString, GraphQLObjectType, GraphQLList } = require(`graphql`) | |||
const _ = require(`lodash`) | |||
const { ObjectTypeComposer, schemaComposer } = require(`graphql-compose`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a convenient helper function!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nice! Glad I stumbled upon it, shoutout to @freiksenet who pointed it out in some really old graphql.js issue 🔥
6ff3d43
to
9a6be09
Compare
Merged into #23291 manually to avoid the squash and merge! |
This adds resource mutations to the Recipes GraphQL server. For every resource, we generate
createX(x: XInput)
,updateX(x: XInput)
anddestroyX(x: XInput)
mutations. This is what that looks like right now: