Skip to content

Propagate the @constraint directive to the client #296

@mat813

Description

@mat813

Hi,

I am using apollo 4 as the server. I followed the
The validations work great on the server side.

Now, I am trying to propagate the input constraints on the client side so I can use graphql-codegen-typescript-validation-schema to generate zod validations that I can use on form inputs.
The directive definition is propagated to the schema that the client sees, but not the @constraint directive on the various input fields.
Maybe I missed something, but I cannot seem to figure out if this can even be done.

As a workaround, I could use constraintDirective schema wrapper, but it changes the type names, and I have to manually create a schema for each, which kinda defeats what I wanted to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions