graphql-validate-directive
Summary
This is a directive validation library for GraphQL. Inspired by validate-directive.
Different with graphql-constraint-directive. It do validate on resolve field instead of creating new scaler.
Installation
yarn add graphql-validate-directive
or
npm i -S graphql-validate-directive
Usage
import {
validateDirective,
GraphQLValidateDirectiveTypeDefs,
} from 'graphql-validate-directive'
import { makeExecutableSchema } from '@graphql-tools/schema'
const schema = makeExecutableSchema({
typeDefs: [
GraphQLValidateDirectiveTypeDefs,
],
resolvers: {
},
})
validateDirective()(schema)