{"id":47886,"library":"graphql-io-client","title":"GraphQL-IO-Client","description":"A GraphQL network communication client framework for Node.js and browser environments (current version 1.8.4). It integrates GraphQL.js, Apollo Client, Axios, and a WebSocket interface to provide queries, mutations, and subscriptions. Compared to raw Apollo Client, it simplifies setup with a unified Client class and automatic transport selection (HTTP/WebSocket). Development appears slow with no recent updates; compatible with Node >=6.0.0. Differentiators include easy-to-use API and built-in WS support.","status":"maintenance","version":"1.8.4","language":"javascript","source_language":"en","source_url":"https://github.com/rse/graphql-io-client","tags":["javascript","graphql","network","communication","framework","client"],"install":[{"cmd":"npm install graphql-io-client","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-io-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-io-client","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core GraphQL parsing/validation engine","package":"graphql","optional":false},{"reason":"Underlying Apollo Client for query execution","package":"@apollo/client","optional":false},{"reason":"WebSocket transport for subscriptions","package":"apollo-client-ws","optional":true},{"reason":"HTTP client for queries and mutations","package":"axios","optional":false}],"imports":[{"note":"The 'Client' is a named export, not default. Both ESM and CommonJS work.","wrong":"import Client from 'graphql-io-client'","symbol":"Client","correct":"import { Client } from 'graphql-io-client'"},{"note":"CommonJS require destructures the named export.","wrong":"const Client = require('graphql-io-client')","symbol":"Client (CJS)","correct":"const { Client } = require('graphql-io-client')"},{"note":"TypeScript users should use 'import type' for types to avoid runtime overhead.","wrong":"import { ClientOptions } from 'graphql-io-client' using value import","symbol":"TypeScript types","correct":"import type { ClientOptions, Client } from 'graphql-io-client'"}],"quickstart":{"code":"const { Client } = require('graphql-io-client');\nconst client = new Client({ url: 'http://127.0.0.1:12345/api' });\n(async () => {\n  await client.connect();\n  const result = await client.query('{ hello }');\n  console.log(result.data);\n  await client.disconnect();\n})();","lang":"javascript","description":"Shows how to import Client, connect, execute a simple GraphQL query, and disconnect."},"warnings":[{"fix":"Always provide a valid GraphQL endpoint URL: new Client({ url: '...' })","message":"The Client constructor requires a 'url' option; omitting it will cause connection failure.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use async/await or .then() when calling connect() and disconnect().","message":"The connect() and disconnect() methods return Promises; forgetting to await them can lead to race conditions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use const { Client } = require('graphql-io-client')","message":"When using CommonJS require, destructure the named export; requiring the entire module yields an object with Client.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For new projects, consider using @apollo/client directly with its own transport.","message":"The package relies on older Apollo Client (v2) and Axios; consider migrating to Apollo Client v3+ and native fetch for new projects.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.8.4':18 '6.0.0':63 'api':70 'apollo':22,38 'appear':54 'automat':49 'axio':24 'browser':14 'built':73 'built-in':72 'class':47 'client':4,9,23,39,46,82 'communic':8,80 'compar':35 'compat':60 'current':16 'develop':53 'differenti':64 'easi':67 'easy-to-us':66 'environ':15 'framework':10,81 'graphql':2,6,78 'graphql-io-cli':1 'graphql.js':21 'http/websocket':52 'includ':65 'integr':20 'interfac':28 'io':3 'javascript':77 'mutat':32 'network':7,79 'node':62 'node.js':12 'provid':30 'queri':31 'raw':37 'recent':58 'select':51 'setup':42 'simplifi':41 'slow':55 'subscript':34 'support':76 'transport':50 'unifi':45 'updat':59 'use':69 'version':17 'websocket':27 'ws':75","created_at":"2026-06-07T16:53:50.219676+00:00","updated_at":"2026-06-07T16:53:50.219676+00:00","problems":[{"fix":"Ensure you pass a non-empty string like '{ hello }'.","cause":"The query argument to client.query() is missing or not a valid GraphQL string.","error":"Error: Must provide document to query"},{"fix":"Use named import: import { Client } from 'graphql-io-client'","cause":"The import did not correctly get the Client class (likely default import instead of named).","error":"TypeError: client.connect is not a function"},{"fix":"Check the url option passed to the Client constructor.","cause":"The server URL is incorrect or server is unreachable.","error":"UnhandledPromiseRejectionWarning: Error: Network error: ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/rse/graphql-io-client","github":"https://github.com/rse/graphql-io-client","docs":null,"changelog":null,"pypi":null,"npm":"graphql-io-client","openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}