Install & Compatibility
Where this runs
tested against v0.2.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 19.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.014s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GraphQLClient
✓ from graphqlclient import GraphQLClient
✗ from graphql_client import GraphQLClient
Wrong hyphen vs underscore
GraphQLClient
✓ from graphqlclient import GraphQLClient
✗ import graphqlclient.GraphQLClient
Submodule doesn't exist
Create a client with the endpoint URL, then execute a GraphQL query string.
from graphqlclient import GraphQLClient
client = GraphQLClient('https://api.example.com/graphql')
result = client.execute('''
query {
viewer {
login
}
}''')
print(result)
Errors
Common errors & fixes
AttributeError: module 'graphqlclient' has no attribute 'GraphQLClient'
Incorrect import: using 'from graphql_client import ...' or 'import graphqlclient' then accessing graphqlclient.GraphQLClient
fixUse: from graphqlclient import GraphQLClient
TypeError: string indices must be integers, not 'str' when trying to access result['data']
execute() returns a raw JSON string; you must parse it first.
fiximport json; result = json.loads(client.execute(query)); print(result['data'])
requests.exceptions.InvalidSchema: No connection adapters were found for 'http://localhost:4000/graphql'
The library only supports http/https URLs but your URL may have a typo or missing scheme.
fixEnsure the URL starts with http:// or https://
Upgrade
Version history
0.2.4latest on PyPI · released Jul 12, 2018
Audit
Dependencies
No dependency data recorded yet.