diff --git a/terraso_backend/apps/graphql/schema/taxnomy_terms.py b/terraso_backend/apps/graphql/schema/taxnomy_terms.py index 5d4285cea..b4a276c36 100644 --- a/terraso_backend/apps/graphql/schema/taxnomy_terms.py +++ b/terraso_backend/apps/graphql/schema/taxnomy_terms.py @@ -24,6 +24,8 @@ logger = structlog.get_logger(__name__) +VALID_TYPES = [key for (key, text) in TaxonomyTerm.TYPES] + class TaxonomyTermNode(DjangoObjectType): id = graphene.ID(source="pk", required=True) @@ -42,3 +44,7 @@ class Meta: ) interfaces = (relay.Node,) connection_class = TerrasoConnection + + @classmethod + def get_queryset(cls, queryset, info): + return queryset.filter(type__in=VALID_TYPES)