Skip to content
Snippets Groups Projects
Commit 888d7e82 authored by Vincent Texier's avatar Vincent Texier Committed by Vincent Texier
Browse files

issue #59 WIP: Add duniter GVA graphql schema

Validate schema in request_swapi.py example
parent 1d38066a
No related branches found
No related tags found
No related merge requests found
schema {
query: Query
}
type Query {
node: Node
}
type Node {
summary: Summary
sandboxes: Sandboxes
}
type Summary {
software: String!
version: String!
forkWindowSize: Int!
}
type Sandbox {
size: Int!
free: Int!
}
type Sandboxes {
identities: Sandbox!
memberships: Sandbox!
transactions: Sandbox!
}
import asyncio import asyncio
import os
import graphql
from duniterpy.api.client import Client from duniterpy.api.client import Client
...@@ -14,6 +17,13 @@ SWAPI_ENDPOINT = "BMAS swapi.graph.cool 443" ...@@ -14,6 +17,13 @@ SWAPI_ENDPOINT = "BMAS swapi.graph.cool 443"
async def main(): async def main():
# validate duniter GVA graphql schema
with open(os.path.join(os.path.dirname(__file__), '../duniterpy/api/gva/schema.qraphql'), 'r') as fd:
document = graphql.parse(fd.read())
schema = graphql.build_ast_schema(document)
print(schema)
client = Client(SWAPI_ENDPOINT) client = Client(SWAPI_ENDPOINT)
query = """query { query = """query {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment