Skip to content

Not possible to manipulate gql parser validation rules #3771

@janisbiz

Description

@janisbiz

Problem

with release of v0.17.76 it is not possible to add/remove custom validators for schema.

Analysis

long story short - this change was introduced. It always initializes a new slice with fixed pre-defined rules to be added when validating schema. This is basically fully locking out any customization for developers when they want to add or remove any rule from defaults defined by vektah/gqlparser

Workaround

there is no way to workaround it. If developers were relying on their own custom rules and/or if they were removing some of pre-defined rules & if they have tests for these scenarios - they would either fail now or developers are not aware of this functionality silently getting broken

Proposal

Expose rules variable so developers can manipulate them based on their needs

OR

Use initialized validator with all it supported methods for adding/removing rules

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