graphql-validation-helper
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i graphql-validation-helper

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • beanloop
  • drager