GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - taskless/graphinql: πŸ•ΈοΈ A zero-dependency graphql client that likes (but does not require) types

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
.husky
.husky
 
 
examples
examples
 
 
src
src
 
 
test
test
 
 
.all-contributorsrc
.all-contributorsrc
 
 
.editorconfig
.editorconfig
 
 
.eslintignore
.eslintignore
 
 
.gitignore
.gitignore
 
 
.lintstagedrc.cjs
.lintstagedrc.cjs
 
 
.npmrc
.npmrc
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
.release-it.json
.release-it.json
 
 
.syncpackrc.json
.syncpackrc.json
 
 
.tool-versions
.tool-versions
 
 
.xo-config.json
.xo-config.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
RELEASING.md
RELEASING.md
 
 
ava.config.js
ava.config.js
 
 
ava.env.cjs
ava.env.cjs
 
 
commitlint.config.cjs
commitlint.config.cjs
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

graphinql logo

@taskless/graphinql

A super-lightweight GraphQL client built on cross-fetch. As few dependencies as possible, works in the browser and server. Specifically built to work with strings and avoid a dependency on graphql / graphql-tag so you can keep your codebase light. In short, the best parts of graphql-request without the graphql dependency, but without losing the ability to type your requests and responses.

  • βœ… Queries, Mutations, Introspection
  • βœ… Custom headers per request or shared via new GraphQLClient()
  • βœ… Typed responses and variables
  • ❌ Typed GraphQL Document Node (exposing these types would force graphql to be a dependency, and risks the "multiple GraphQL" bug even for types-only support)
    • Note: If you need the Typed Document Node, you should use the excellent graphql-request library
  • ❌ Subscriptions (operates over https fetch)

BREAKING CHANGE (4.x)

⚠️ With node 18 providing a What-WG compatible fetch, version 4.0 of graphinql no longer provides a fetch by default nor includes p-retry. If you need these features, you can provide them yourself, via the new fetch option.

Usage

import { GraphQLClient, request } from "@taskless/graphinql";

// as an object
const client = new GraphQLClient(endpoint, options);
const { data, error } = await client.request<TReturnType, TVariables>(
  stringDocument,
  {
    // variables
  },
  {
    // options
  }
);

// or as a one-off
request<TReturnType, TVariables>(endpoint, stringDocument, variables, options);
  • endpoint Your GraphQL endpoint
  • stringDocument A GraphQL query, as a string
  • variables (optional) GraphQL Variables if applicable
  • options (optional) A set of GraphQL Client options, provided as an object
    • options.headers<HeadersInit> (optional) A Headers compatible object, specifying headers to include with the request
    • options.fetch<typeof fetch> (optional) A What-WG compatible fetch interface

Additional Examples

  • Using a ponyfilled fetch
  • Using a p-retry for retrying requests

About the Name

This library was originally built on phin before migrating to a What-WG fetch solution.

Contributors

All Contributors

Jakob Heuser
Jakob Heuser

πŸ’» πŸš‡ πŸ“–
takanome_dev
takanome_dev

πŸ“– πŸ’»
Samuel Giddins
Samuel Giddins

πŸ’» πŸš‡ ⚠️

License

The source code in this repository is made available under the MIT license.

About

πŸ•ΈοΈ A zero-dependency graphql client that likes (but does not require) types

Topics

browserfetchfetch-apigraphqlnodejszero-dependency

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.