From 53a85323194d38cd8625d9fd7d54859373155178 Mon Sep 17 00:00:00 2001 From: squak Date: Tue, 1 Feb 2022 16:49:58 +0300 Subject: [PATCH] feat: add GraphQL schema for testing --- tests/schema.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/schema.py diff --git a/tests/schema.py b/tests/schema.py new file mode 100644 index 0000000..a50eae3 --- /dev/null +++ b/tests/schema.py @@ -0,0 +1,44 @@ +"""GraphQL schema.""" +import graphene +from graphene_django_filter import AdvancedDjangoFilterConnectionField + +from .object_types import ( + TaskFilterFieldsType, + TaskFilterSetClassType, + TaskGroupFilterFieldsType, + TaskGroupFilterSetClassType, + UserFilterFieldsType, + UserFilterSetClassType, +) + + +class Query(graphene.ObjectType): + """Schema queries.""" + + user_fields = AdvancedDjangoFilterConnectionField( + UserFilterFieldsType, + description='Advanced filter fields with the `UserFilterFieldsType` type', + ) + user_filter_set = AdvancedDjangoFilterConnectionField( + UserFilterSetClassType, + description='Advanced filter fields with the `UserFilterSetClassType` type', + ) + task_fields = AdvancedDjangoFilterConnectionField( + TaskFilterFieldsType, + description='Advanced filter field with the `TaskFilterFieldsType` type', + ) + task_filter_set = AdvancedDjangoFilterConnectionField( + TaskFilterSetClassType, + description='Advanced filter field with the `TaskFilterSetClassType` type', + ) + task_group_fields = AdvancedDjangoFilterConnectionField( + TaskGroupFilterFieldsType, + description='Advanced filter field with the `TaskGroupFilterFieldsType` type', + ) + task_group_filter_set = AdvancedDjangoFilterConnectionField( + TaskGroupFilterSetClassType, + description='Advanced filter field with the `TaskGroupFilterSetClassType` type', + ) + + +schema = graphene.Schema(query=Query)