graphene-validator icon indicating copy to clipboard operation
graphene-validator copied to clipboard

Offer validation with a simple function

Open akikoskinen opened this issue 4 years ago • 2 comments

The @validated class decorator doesn't work with mutation classes inherited from Graphene's relay.ClientIDMutation, as issue #10 explains.

The @validated class decorator also always performs validation before the mutation class's actual mutate function is entered. That might not always be what is needed. There are use cases (e.g authorisation) where some work should be done by the mutate function before input validation is done.

The validation function proposed in this PR solves (or can be used to circumvent) both of these problems.

TODO:

This PR is a draft for getting comments about the proposed idea. The follwing items need to be completed before this should be merged in.

  • [ ] write documentation

akikoskinen avatar Sep 08 '21 10:09 akikoskinen

@chpmrc Would you like to check out this PR and give some comments?

akikoskinen avatar Sep 23 '21 08:09 akikoskinen

Yep I'll take a look, thanks! Can we break things down into smaller PRs next time though? I can quickly review smaller PRs whenever I have some time ;)

elchiapp avatar Sep 23 '21 10:09 elchiapp