Skip to content

AIOHTTPTransport ignore backend mimetype #246

@mirkan1

Description

@mirkan1

well. this line need to be changed from

result = await resp.json()

to

result = await resp.json(content_type=None)

It was giving me errors while I am trying to get data using headers with API key
EXAMPLE CODE:

query = """query { lookup(placekey: "222-224@5vg-7gr-6kz") { placekey safegraph_core { location_name street_address city region postal_code iso_country_code } } }"""
async def async_main():
    transport = AIOHTTPTransport(
        url='https://api.safegraph.com/v1/graphql',
        headers={'Content-Type': 'application/json', 'apikey': "__KEY__"}
    )
    __query__ = gql(query) 
    async with gql_Client(
        transport=transport, fetch_schema_from_transport=True,
    ) as session:
        result = await session.execute(__query__)
    print(result)
    return result

guys my library depends on gql mainly so, let me know what I can do. I need to make it work async, and this line need to be different I think. I will test it again with the latest patch too. https://pypi.org/project/safegraphQL
version: gql==3.0.0a1

result = await resp.json()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions