graphql.github.io icon indicating copy to clipboard operation
graphql.github.io copied to clipboard

Code sample for ariadne-codegen is outdated.

Open alexdev-wb opened this issue 2 years ago • 1 comments

Description

Code sample for ariadne-codegen is outdated.

Motivation

Relevant code sample for ariadne-codegen.

Collaboration

Replace the code with something like this:

import asyncio
from graphql_client import Client


async def fetch_gql():
    client = Client("http://example.com/graphql/")
    result = await client.create_token(username="Admin", password="Example123")

    if result.errors:
        error = result.errors[0]
        raise ValidationError({error.field: error.message})

    auth_token = result.token

asyncio.run(fetch_gql())

alexdev-wb avatar Apr 04 '23 00:04 alexdev-wb

thanks! could you submit a PR with a fix?

Urigo avatar Apr 09 '23 18:04 Urigo