Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 612 Bytes

local_schema.rst

File metadata and controls

25 lines (16 loc) · 612 Bytes

Execution on a local schema

It is also possible to execute queries against a local schema (so without a transport), even if it is not really useful except maybe for testing.

from gql import gql, Client

from .someSchema import SampleSchema

client = Client(schema=SampleSchema)

query = gql('''
    {
      hello
    }
''')

result = client.execute(query)

See tests/starwars/test_query.py for an example