Skip to content

Look into GraphQLite's new custom InputType validation hook #63

Open
@oojacoboo

Description

@oojacoboo

In GraphQLite version 6, this PR (thecodingmachine/graphqlite#435), provides support for the new SchemaFactory::setInputTypeValidator. With this new implementation, Input annotated objects can have validation triggered. This entirely removes the need for controller level calls in every method, and removes the possibility of a dev forgetting to do so.

This becomes a centralized place for all validation on all input types. Using it in conjunction with Symfony's annotation based validation is an obvious choice, among other possible custom needs.

This bundle would improve if it leveraged that as a default and fell back to manually calling validation when InputType objects are instantiated through a factory. Or, if someone would like to submit a PR to GraphQLite to extend the InputTypeValidatorInterface to support Factory constructed InputTypes as well, that'd be great.

Docs: https://graphqlite.thecodingmachine.io/docs/validation#custom-inputtype-validation

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