Registry / api-client / grapheetee

grapheetee

JSON →
library0.1.0jsnpmunverified

Fetch-based GraphQL client for browser and Node.js. Version 0.1.0 provides a minimal client supporting both query and mutation operations, with optional uploads for mutations. It leverages the native Fetch API in browsers and requires a fetch polyfill in Node (a separate Node entry point is provided). Key differentiator: lightweight and dependency-free if fetch is available, though early-stage with no breaking changes yet documented.

npm install grapheetee
INSTALL
IMPORT
SIG · GRAPHEETEE
G
grapheetee
api-clientjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Grapheetee
import Grapheetee from 'grapheetee'
const Grapheetee = require('grapheetee')
Browser entry is ESM-only; use 'grapheetee/node' for CommonJS in Node.
Grapheetee (Node)
const Grapheetee = require('grapheetee/node')
const Grapheetee = require('grapheetee')
Node requires a fetch polyfill; the '/node' entry handles it automatically.
Grapheetee
import Grapheetee from 'grapheetee'
import { Grapheetee } from 'grapheetee'
Grapheetee is a default export, not named.

Create a Grapheetee client, send a query, and log the result.

import Grapheetee from 'grapheetee'; const client = new Grapheetee({ url: 'https://api.example.com/graphql' }); async function main() { const data = await client.query({ query: `{ hello { name greeting } }`, }); console.log(data); } main().catch(console.error);
Debug
Known issues
gotchaGrapheetee uses Fetch API; Node.js requires a polyfill or the '/node' entry point.
fix
Use 'grapheetee/node' for Node.js or provide global fetch, Request, and Headers.
affects: >=0.0.0
gotchaConstructor requires a 'url' option; missing it throws an error.
fix
Always supply url: new Grapheetee({ url: '...' })
affects: >=0.0.0
gotchaMutation method 'mutation()' accepts an optional 'uploads' array for file uploads; not using it incorrectly may cause issues.
fix
Provide uploads as an array of objects with field, file, and filename.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: fetch is not a function
Running in Node.js without a fetch polyfill or using the browser entry instead of '/node'.
fix
Use `require('grapheetee/node')` or provide global fetch.
Missing required option: url
Creating Grapheetee instance without 'url' option.
fix
Instantiate with `new Grapheetee({ url: '...' })`.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
30
OpenAI (training)
1
Resources
grapheetee — npm install grapheetee · libregistry