Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
graphql-validate-directive
Advanced tools
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.
yarn add graphql-validate-directive
or
npm i -S graphql-validate-directive
Use in the project.
import {
validateDirective,
GraphQLValidateDirectiveTypeDefs,
} from 'graphql-validate-directive'
import { makeExecutableSchema } from '@graphql-tools/schema'
const schema = makeExecutableSchema({
typeDefs: [
// ... your type definitions
GraphQLValidateDirectiveTypeDefs,
],
resolvers: {
// ...
},
})
validateDirective()(schema)
Use in schema.
# used on input field
input PostInput {
title: String! @validate(minLength: 1, maxLength: 1000)
content: String! @validate(minLength: 1, maxLength: 1000)
# used on array
tags: [String!]
@validate(minItems: 1, maxItems: 10, minLength: 1, maxLength: 100)
}
type Mutation {
createPost(input: PostInput!): Post
# used on argument
createMessage(
content: String! @validate(minLength: 1, maxLength: 200)
): Message
}
MIT Licensed.
FAQs
A GraphQL directive for input validation
The npm package graphql-validate-directive receives a total of 27 weekly downloads. As such, graphql-validate-directive popularity was classified as not popular.
We found that graphql-validate-directive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.