{"id":23817,"library":"graphqlclient","title":"graphqlclient","description":"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.","status":"maintenance","version":"0.2.4","language":"python","source_language":"en","source_url":"https://github.com/prismagraphql/python-graphql-client","tags":["graphql","client","api","deprecated"],"install":[{"cmd":"pip install graphqlclient","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Wrong hyphen vs underscore","wrong":"from graphql_client import GraphQLClient","symbol":"GraphQLClient","correct":"from graphqlclient import GraphQLClient"},{"note":"Submodule doesn't exist","wrong":"import graphqlclient.GraphQLClient","symbol":"GraphQLClient","correct":"from graphqlclient import GraphQLClient"}],"quickstart":{"code":"from graphqlclient import GraphQLClient\n\nclient = GraphQLClient('https://api.example.com/graphql')\nresult = client.execute('''\nquery {\n  viewer {\n    login\n  }\n}''')\nprint(result)","lang":"python","description":"Create a client with the endpoint URL, then execute a GraphQL query string."},"warnings":[{"fix":"Use f-strings or string formatting to manually interpolate variables into the query.","message":"The client does not support variables in a structured way; you must embed them directly in the query string.","severity":"gotcha","affected_versions":"all"},{"fix":"import json; result = json.loads(client.execute(query))","message":"Error handling is minimal: the execute method returns raw JSON string, not a parsed dict. You must call json.loads() yourself.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to gql (pip install gql) with an AIOHTTP or Requests transport.","message":"This library is no longer maintained. For production use, consider a more modern client like gql or sgqlc.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"client = GraphQLClient('https://api.github.com/graphql'); client.inject_token('bearer YOUR_TOKEN')","message":"Authentication headers must be set via the init method, not through a dedicated auth parameter.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from graphqlclient import GraphQLClient","cause":"Incorrect import: using 'from graphql_client import ...' or 'import graphqlclient' then accessing graphqlclient.GraphQLClient","error":"AttributeError: module 'graphqlclient' has no attribute 'GraphQLClient'"},{"fix":"import json; result = json.loads(client.execute(query)); print(result['data'])","cause":"execute() returns a raw JSON string; you must parse it first.","error":"TypeError: string indices must be integers, not 'str' when trying to access result['data']"},{"fix":"Ensure the URL starts with http:// or https://","cause":"The library only supports http/https URLs but your URL may have a typo or missing scheme.","error":"requests.exceptions.InvalidSchema: No connection adapters were found for 'http://localhost:4000/graphql'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}