Skip to content

Commit

Permalink
feat: add GraphQL schema for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
SquakR committed Feb 1, 2022
1 parent a59deb6 commit 53a8532
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/schema.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 53a8532

Please sign in to comment.