Registry / http-networking / graphqlclient

graphqlclient

JSON →
library0.2.4pypypi✓ verified 84d ago

A minimal GraphQL client for Python 2.7+ (and 3.x) that provides a simple way to execute queries and mutations. Current version 0.2.4, last released in 2018. The library is in maintenance mode with no active development.

pip install graphqlclient
INSTALL
IMPORT
SIG · GRAPHQLCLIENT
G
graphqlclient
http-networkingpythonv0.2.4
Install
2.4s avg
Import
16ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 19.3MB
glibc
py 3.103.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)
Debug
Known issues
gotchaThe client does not support variables in a structured way; you must embed them directly in the query string.
fix
Use f-strings or string formatting to manually interpolate variables into the query.
affects: all
gotchaError handling is minimal: the execute method returns raw JSON string, not a parsed dict. You must call json.loads() yourself.
fix
import json; result = json.loads(client.execute(query))
affects: all
deprecatedThis library is no longer maintained. For production use, consider a more modern client like gql or sgqlc.
fix
Migrate to gql (pip install gql) with an AIOHTTP or Requests transport.
affects: >=0.2.0
gotchaAuthentication headers must be set via the init method, not through a dedicated auth parameter.
fix
client = GraphQLClient('https://api.github.com/graphql'); client.inject_token('bearer YOUR_TOKEN')
affects: all
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
fix
Use: 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.
fix
import 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.
fix
Ensure 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.

Agent activity
6 hits · last 30 days
node
6
Resources
graphqlclient — pip install graphqlclient · libregistry