"""Docstring.""" import pprint from gql import Client, gql from gql.transport.requests import RequestsHTTPTransport profile_id = '516' profile_type = 'InsightsProfile' isrc = 'GBUM71105426' url = 'https://qa-graphql-gateway.theorchard.io/graphql' client_name = 'paul-test' transport = RequestsHTTPTransport( url=url, use_json=True, headers={ 'Orchard-Profile-Id': profile_id, 'Orchard-Profile-Type': profile_type, 'apollographql-client-name': client_name, 'apollographql-client-version': '1' }, verify=True, retries=3 ) client = Client( transport=transport, fetch_schema_from_transport=False, ) query = gql(""" query globalSoundRecordingCatalogSearch($term: String) { globalSoundRecordingCatalogSearch(term: $term, offset: 0, first: 1) { labelSoundRecordings { tracks { id } } } } """) params = {'term': isrc} result = client.execute(query, variable_values=params) pprint.pprint(result)