graphql-core-legacy
graphql-core-legacy copied to clipboard
Add support for custom validators
Support extending the GraphQLCoreBackend
class with custom validators by
adding a function get_validation_rules
that can be overridden in
subclasses where needed.
This change in combination with setting the default graphql backend allows for easy additions to validation rules. An example use case would be if there's a need to perform query cost or depth analysis, one can create a validator that restricts execution of the query based on it's execution cost.
Of course this could also be used to remove validators if that is necessary for some use case.
Resolves #267
Seems like Python 3.5 doesn't like mock's assert_called_once
function, will have to check that. Let me know if there's something else wrong with this and I'll include those changes at the same time.