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

Add mutations to Recipes GraphQL server #23335

Closed
wants to merge 12 commits into from

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Apr 21, 2020

This adds resource mutations to the Recipes GraphQL server. For every resource, we generate createX(x: XInput), updateX(x: XInput) and destroyX(x: XInput) mutations. This is what that looks like right now:

Screenshot 2020-04-21 at 10 31 53

@mxstbr mxstbr requested a review from a team as a code owner April 21, 2020 07:45
@mxstbr mxstbr marked this pull request as draft April 21, 2020 07:46
@mxstbr mxstbr marked this pull request as ready for review April 21, 2020 07:48
@LekoArts
Copy link
Contributor

Would it be sensible to update the current test for this file or add more tests? The current test seems a bit sparse.

Copy link
Contributor

@KyleAMathews KyleAMathews left a 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`)
Copy link
Contributor

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!

Copy link
Contributor Author

@mxstbr mxstbr Apr 21, 2020

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 🔥

@mxstbr mxstbr requested review from a team as code owners April 22, 2020 10:18
@mxstbr mxstbr force-pushed the feat/recipes-graphql-mutations branch from 6ff3d43 to 9a6be09 Compare April 22, 2020 11:30
@mxstbr
Copy link
Contributor Author

mxstbr commented Apr 22, 2020

Merged into #23291 manually to avoid the squash and merge!

@mxstbr mxstbr closed this Apr 22, 2020
@mxstbr mxstbr deleted the feat/recipes-graphql-mutations branch April 22, 2020 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants