Skip to content

About

A Vite plugin for loading GraphQL files.

Topics

Resources

Stars

25 stars

Watchers

2 watching

Forks

Repository files navigation

graphql-loader

Loads GraphQL .gql and .graphql files as ES modules, for Vite and for Bun.

Package npm Use with
vite-plugin-graphql-loader npm Vite 5, 6, 7, 8
bun-graphql-loader npm bun build, bun test

Layout

packages/core    shared transform + the snippets injected into emitted modules
packages/vite    -> vite-plugin-graphql-loader
packages/bun     -> bun-graphql-loader
tests            shared fixtures, run under vitest and bun test
integration-test a real Vite build consuming the published package layout

Development

bun install
bun run test:run     # vitest (shared fixtures) + bun test (Bun runtime/build)
bun run typecheck
bun run lint
bun run build        # builds both packages

The tests/testcases fixtures are golden files. Delete a -expected.js and re-run the tests twice to regenerate it.

Releasing

Tags select the package: vite-v6.0.0 publishes packages/vite, bun-v2.0.0 publishes packages/bun. Both are setup to use npm Trusted Publishing.

About

A Vite plugin for loading GraphQL files.

Topics

Resources

Stars

25 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages