Skip to content

Schema

snoop.data.schema #

Here we define the schema for our GraphQL endpoints. There is one endpoint for each collection.

We use graphene_django to make the django models available to the GraphQL queries.

Classes#

Digest #

Graphene class for the digest model from django.

Entity #

Graphene class for the entity model from django.

EntityHit #

Graphene class for the Entity Hit model from django.

EntityType #

Graphene class for the Entity Type model from django.

Query #

Define the schema for GraphQL queries.

Methods#
resolve_digests(self, info) #

Define what should be returned when querying for digests.

Source code in snoop/data/schema.py
def resolve_digests(self, info):
    """Define what should be returned when querying for digests."""
    return DigestModel.objects.all()
resolve_entities(self, info) #

Define what should be returned when querying for entities.

Source code in snoop/data/schema.py
def resolve_entities(self, info):
    """Define what should be returned when querying for entities."""
    return EntityModel.objects.all()
resolve_entityHits(self, info) #

Define what should be returned when querying for entity Hits.

Source code in snoop/data/schema.py
def resolve_entityHits(self, info):
    """Define what should be returned when querying for entity Hits."""
    return EntityHitModel.objects.all()
resolve_entityTypes(self, info) #

Define what should be returned when querying for entity type.

Source code in snoop/data/schema.py
def resolve_entityTypes(self, info):
    """Define what should be returned when querying for entity type."""
    return EntityTypeModel.objects.all()