0.2.0 • Published 7 years ago

graphql-validation-helper v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

graphql-validation-helper

Build Status npm version License

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.