Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active August 31, 2017 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/243b09e2298b3ac0bd1f715cb560b560 to your computer and use it in GitHub Desktop.
Save matthieu-D/243b09e2298b3ac0bd1f715cb560b560 to your computer and use it in GitHub Desktop.
var MutationDelete = {
type: new GraphQLList(UserType),
description: 'Delete a User',
args: {
id: {
name: 'User id',
type: new GraphQLNonNull(GraphQLFloat)
}
},
resolve: (root, {id}) => {
USERs = USERs.filter(function(user) {
return user.id !== id;
});
return USERs;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment