31 lines
747 B
Python
31 lines
747 B
Python
from gql import gql, Client
|
|
from gql.transport.aiohttp import AIOHTTPTransport
|
|
|
|
transport = AIOHTTPTransport(url="https://gql.ivazh.ru/graphql/")
|
|
|
|
|
|
def get_classifier():
|
|
client = Client(transport=transport, fetch_schema_from_transport=True)
|
|
query = gql(
|
|
"""
|
|
query getClassifier {
|
|
getClassifier(name: "ood")
|
|
}
|
|
"""
|
|
)
|
|
result = client.execute(query)
|
|
return result['getClassifier']
|
|
|
|
|
|
def get_catalog():
|
|
client = Client(transport=transport, fetch_schema_from_transport=True)
|
|
query = gql(
|
|
"""
|
|
query getCatalog {
|
|
getCatalog(name: "ood")
|
|
}
|
|
"""
|
|
)
|
|
result = client.execute(query)
|
|
return result['getClassifier']
|