Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/resolvers/resolvers.py
# Copyright (C) 2022 The Software Heritage developers | # Copyright (C) 2022 The Software Heritage developers | ||||||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||||||
""" | """ | ||||||||
High level resolvers | High level resolvers | ||||||||
Any schema attribute can be resolved by any of the following ways | |||||||||
and in the following priority order | |||||||||
- In this module using an annotation (eg: @visitstatus.field("snapshot")) | |||||||||
- As a property in the Node object (eg: resolvers.visit.OriginVisitNode.id) | |||||||||
- As an attribute/item in the object/dict returned by the backend (eg: Origin.url) | |||||||||
""" | """ | ||||||||
# Any schema attribute can be resolved by any of the following ways | |||||||||
# and in the following priority order | |||||||||
vlorentzUnsubmitted Done Inline Actions
vlorentz: | |||||||||
# - In this module using a decorator (eg: @visitstatus.field("snapshot")) | |||||||||
# - As a property in the Node object (eg: resolvers.visit.BaseVisitNode.id) | |||||||||
# - As an attribute/item in the object/dict returned by a backend (eg: Origin.url) | |||||||||
from ariadne import ObjectType, UnionType | from ariadne import ObjectType, UnionType | ||||||||
from graphql.type import GraphQLResolveInfo | from graphql.type import GraphQLResolveInfo | ||||||||
from swh.graphql import resolvers as rs | from swh.graphql import resolvers as rs | ||||||||
from swh.graphql.utils import utils | from swh.graphql.utils import utils | ||||||||
from .resolver_factory import get_connection_resolver, get_node_resolver | from .resolver_factory import get_connection_resolver, get_node_resolver | ||||||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |