Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

beanloop/graphql-validation-helper

Repository files navigation

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.

Releases

No releases published

Packages

No packages published