Created
December 2, 2022 16:39
-
-
Save rposborne/eef63e4c403c137e2135d8ed39d3330e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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