Skip to content

Use @Pattern directive to validate entries within a List/Array query argument #18

@setchy

Description

@setchy

I was looking to use the @pattern directive to validate that each String within an [String] query argument matches a given pattern (for example, 4 characters).

Is there a trick/workaround to getting this to work or is it a gap at the moment?

As an example, something like below would make sure that each icao provided is 4 characters in length

type Query {
    airports(
        icaos: [String] @Pattern(regexp: "^[a-zA-Z]{4}$")
    )
}

PS - this library is proving to be super helpful for validation conditions. Great stuff!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions