graphql-validation-helper
Install
yarn add graphql-validation-helper
npm install --save graphql-validation-helper
Usage
validatedMutation('user', gql`
mutation createUser(
$firstName: String!
$lastName: String!
$displayName: String!
$email: String!
) {
createUser(
firstName: $firstName
lastName: $lastName
displayName: $displayName
email: $email
) {
id
firstName
lastName
displayName
email
}
}
`, {
mapVariables(user) {
return {...user, displayName: `${user.firstName}${user.lastName}`}
},
}),
License
graphql-validation-helper is dual-licensed under Apache 2.0 and MIT
terms.