{"repo":"confuser/graphql-constraint-directive","free":true,"listed":false,"github":"https://github.com/confuser/graphql-constraint-directive","clone":"git clone https://github.com/confuser/graphql-constraint-directive.git","description":"Validate GraphQL fields","language":"JavaScript","stars":577,"topics":["graphql","nodejs","validation","directive","constraint","validator"],"license":"ISC","category":"api-integrations-sdks","readme_excerpt":"graphql-constraint-directive Allows using @constraint as a directive to validate input data. Inspired by Constraints Directives RFC and OpenAPI Install For GraphQL v15 and below, use v2 of this package Usage There are multiple ways to make use of the constraint directive in your project. Below outlines the benefits and caveats. Please choose the most appropriate to your use case. Schema wrapper Implementation based on schema wrappers - basic scalars are wrapped as custom scalars with validations. Benefits based on graphql library, works everywhere posibility to also validate GraphQL response data Caveats modifies GraphQL schema, basic scalars (Int, Float, String) are replaced by custom scalars Server plugin Implementation based on server plugin. Common server plugins are implemented, function validateQuery(schema, query, variables, operationName) can be used to implement additional plugins. Benefits schema stays unmodified Caveats runs only in supported servers validates only GraphQL query, not response data Envelop Use as an Envelop plugin in supported frameworks, e.g. GraphQL Yoga. Functionality is plugged in execute phase This plugin requires the following dependencies installed in your project: @envelop/core - ^2.0.0 Apollo 3 Server As an Apollo 3 Server plugin This plugin requires the following dependencies installed in your project: dependencies required for your selected Apollo Server 3 variant Apollo 4 Server As an Apollo 4 Server plugin This plugin requires the follo","default_branch":null,"files":null,"tree":[],"storefront":"/r/confuser","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/confuser/graphql-constraint-directive/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}