graphql-nexus / nexus

Code-First, Type-Safe, GraphQL Schema Construction
https://nexusjs.org
MIT License
3.4k stars 275 forks source link

How to check input integer range? #861

Open ziimakc opened 3 years ago

ziimakc commented 3 years ago

Is there a way to check if a intVal range (min, max) not in query resolver? It doesn't seem that schemaDirectives is working with nexus makeSchema.

args: {
    intVal: intArg(),
},
Sytten commented 3 years ago

We are working on directives here https://github.com/graphql-nexus/nexus/pull/952, but what you want is a plugin that adds some properties to intArg. The plugin section is not well defined, but it might be a good idea to add that has a first party plugin.