You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you be willing to expose the validate functions in scalars/number.js and scalars/string.js? I would like to be able to manually validate fields on the client side without having to construct a GraphQL mutation.
I can probably make a PR if you are interested!
The scenario is being able to reuse these constraint directives to also validate things like HTML forms (which would not necessarily use GraphQL, but would logically still be the same types).
More context if you are interested: I'm writing a codegen plugin for @graphql-codegen/cli which takes in a declaration such as:
import{validateString}from'graphql-constraint-directive';// this part missingexportconstUserValidator={email: (value: string)=>validateString('email',{format: "email"},value)}
The text was updated successfully, but these errors were encountered:
Hi there! Thanks for the awesome package!
Would you be willing to expose the
validate
functions inscalars/number.js
andscalars/string.js
? I would like to be able to manually validate fields on the client side without having to construct a GraphQL mutation.I can probably make a PR if you are interested!
The scenario is being able to reuse these constraint directives to also validate things like HTML forms (which would not necessarily use GraphQL, but would logically still be the same types).
More context if you are interested: I'm writing a codegen plugin for
@graphql-codegen/cli
which takes in a declaration such as:and produces:
The text was updated successfully, but these errors were encountered: