Skip to content

Instantly share code, notes, and snippets.

@rposborne
Created December 2, 2022 16:39
Show Gist options
  • Save rposborne/eef63e4c403c137e2135d8ed39d3330e to your computer and use it in GitHub Desktop.
Save rposborne/eef63e4c403c137e2135d8ed39d3330e to your computer and use it in GitHub Desktop.
import os
from pathlib import Path
from gql import Client
from gql.transport.requests import RequestsHTTPTransport
# TO UPDATE
# gql-cli https://app-9377.on-aptible.com/graphql --print-schema >| schema.graphql
# prettier -w schema.graphql
with open(
Path(
os.path.join("schema.graphql"),
)
) as f:
HEALTHIE_GQL_SCHEMA = f.read()
def test():
print("starting run ...")
transport = RequestsHTTPTransport(
url="https://app-9377.on-aptible.com/graphql",
verify=True,
retries=3,
headers={},
)
Client(transport=transport, schema=HEALTHIE_GQL_SCHEMA, parse_results=True)
if __name__ == "__main__":
import timeit
timer = timeit.Timer("test()", setup="from __main__ import test; gc.enable()")
print(timer.repeat(repeat=10, number=1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment