graphene-django/graphene_django/tests/urls_validation.py
Kien Dang feb7252b8a
Add support for validation rules (#1475)
* Add support for validation rules

* Enable customizing validate max_errors through settings

* Add tests for validation rules

* Add examples for validation rules

* Allow setting validation_rules in class def

* Add tests for validation_rules inherited from parent class

* Make tests for validation rules stricter
2023-12-20 12:48:45 +03:00

27 lines
651 B
Python

from django.urls import path
from graphene.validation import DisableIntrospection
from ..views import GraphQLView
from .schema_view import schema
class View(GraphQLView):
schema = schema
class NoIntrospectionView(View):
validation_rules = (DisableIntrospection,)
class NoIntrospectionViewInherited(NoIntrospectionView):
pass
urlpatterns = [
path("graphql/", View.as_view()),
path("graphql/validation/", View.as_view(validation_rules=(DisableIntrospection,))),
path("graphql/validation/alternative/", NoIntrospectionView.as_view()),
path("graphql/validation/inherited/", NoIntrospectionViewInherited.as_view()),
]