diff --git a/swh/graphql/backends/archive.py b/swh/graphql/backends/archive.py index 156bfb1..d5d7f67 100644 --- a/swh/graphql/backends/archive.py +++ b/swh/graphql/backends/archive.py @@ -1,2 +1,15 @@ -def get_origin(): - return {"url": "example.com"} +class Origin: + url = "test" + + +def get_origins(): + # return Origin() + return [ + {"url": "test1.example.com"}, + {"url": "test2.example.com"}, + {"url": "test3.example.com"}, + {"url": "test4.example.com"}, + {"url": "test5.example.com"}, + {"url": "test6.example.com"}, + {"url": "test7.example.com"}, + ] diff --git a/swh/graphql/resolvers/origin.py b/swh/graphql/resolvers/origin.py index 82df2e0..a7693fd 100644 --- a/swh/graphql/resolvers/origin.py +++ b/swh/graphql/resolvers/origin.py @@ -1,28 +1,29 @@ from ariadne import ObjectType from . import query -from ..backends import archive +from swh.graphql.backends import archive origin = ObjectType("Origin") @query.field("origin") def resolve_origin(_, info, url): """ """ - origin = archive.get_origin() - return origin + origin = archive.get_origins() + return origin[0] @origin.field("url") def url(origin, info): """ """ + # return origin.url return origin["url"] @origin.field("visits") def visits(origin, info): """ """ return [{"status": "success"}]