Awesome GraphQL Client is a lightweight, zero-dependency GraphQL client library designed for both NodeJS and browser environments. It currently ships as v3.0.0 and is ESM-only. The library's core feature set includes robust GraphQL File Upload support as per the `graphql-multipart-request-spec`, full TypeScript integration, and compatibility with GraphQL queries generated by `graphql-tag`. While it does not specify a strict release cadence, the project shows consistent maintenance with regular updates addressing features, bug fixes, and Node.js version compatibility. Key differentiators include its minimal footprint (around 2KB gzipped), built-in file upload capabilities, and suitability for modern React applications when paired with libraries like `react-query`.
npm install awesome-graphql-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate `AwesomeGraphQLClient` in a NodeJS environment, perform a GraphQL mutation with file upload support using `node:fs` and the global `File` API (available in Node.js v20+), and includes basic error handling. It creates a temporary image file for the upload example.
Migrate your codebase to use ES module `import` syntax. Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).
Upgrade your Node.js runtime to version 18.18.0 or higher. For version 3.0.0, Node.js 20.19.0 || ^22.12.0 || >=23 is required.
Upgrade your Node.js runtime to version 14 or higher. For current versions, refer to the `engines` field in `package.json`.
If you intend to use `graphql-tag` for parsing template literals, install and import it separately. Use `awesome-graphql-client`'s `gql` only if you specifically need its internal formatting capabilities as documented.
Ensure your Node.js version meets the requirements (v20+ recommended for `File`), or explicitly import `File` from `node:buffer`. Use `openAsBlob` for creating `Blob` objects from local file paths.
Update your import statements from `const Client = require('awesome-graphql-client');` to `import { AwesomeGraphQLClient } from 'awesome-graphql-client';`. Ensure your `package.json` contains `"type": "module"` or files use `.mjs` extension.Refactor your import to `import { AwesomeGraphQLClient } from 'awesome-graphql-client';` for ESM, or if still in a CJS environment (which is not supported since v3), you might attempt `const { AwesomeGraphQLClient } = await import('awesome-graphql-client');` but full CJS compatibility is removed in v3.Upgrade your Node.js installation to a supported version (20.19.0, 22.12.0, or newer). Use a tool like `nvm` (Node Version Manager) for easy version switching.
Provide a `fetch` polyfill to the client configuration: `new AwesomeGraphQLClient({ endpoint: '/graphql', fetch: require('node-fetch') })` (for Node.js versions without native `fetch`) or ensure your Node.js version is recent enough (v18+ for global fetch).No dependency data recorded yet.