惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
F
Fortinet All Blogs
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
MyScale Blog
MyScale Blog
B
Blog
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
IT之家
IT之家
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
博客园_首页
L
LangChain Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
graphiql.git - GraphiQL with Svelte
NetOpWibby · 2026-05-07 · via Hacker News: Show HN

@eeeooolll/graphiql

A Svelte 5 GraphiQL alternative. CodeMirror 6 under the hood, runes-only state, SSR-safe, zero build config for SvelteKit consumers.

Published on npm as @eeeooolll/graphiql.

Install

bun add @eeeooolll/graphiql

Requires Svelte 5. The package ships .svelte sources — your SvelteKit/Vite build compiles them against your own Svelte version.

Entry points

  • @eeeooolll/graphiql — utilities, fetchers, stores, types (TS-only)
  • @eeeooolll/graphiql/component — the GraphiQL Svelte component (default export)
  • @eeeooolll/graphiql/splitter — the Splitter Svelte component (default export)

Component entry points are separate from the TS API so SvelteKit/Vite can resolve .svelte SFCs through their dedicated bundler hooks.

Usage

<script lang="ts">
  import { createHttpFetcher } from "@eeeooolll/graphiql";
  import GraphiQL from "@eeeooolll/graphiql/component";

  const fetcher = createHttpFetcher({ url: "/graphql" });
</script>

<GraphiQL {fetcher}/>

Full prop list:

Prop Type Default
fetcher Fetcher (required)
initialQuery string ""
namespace string "eol-graphiql"
resultFooter Snippet<[{ result: string }]> undefined
storage Storage localStorage-based
subscriptionMode "append" \| "replace" "append"
tabExtras Snippet<[{ tab: Tab }]> undefined
theme Extension (CodeMirror) lightTheme
toolbarExtras Snippet undefined

Integration

The component only needs a Fetcher — a function that takes { query, variables, operationName, headers } and returns either a Promise<FetcherResult> (HTTP) or an AsyncIterable<FetcherResult> (SSE/WS). That's the full seam. Any GraphQL server that speaks HTTP JSON works out of the box via createHttpFetcher.

GraphQL Yoga

// server.ts
import { createYoga, createSchema } from "graphql-yoga";

export const yoga = createYoga({
  schema: createSchema({
    resolvers: { Query: { hello: () => "world" } },
    typeDefs: /* GraphQL */ `type Query { hello: String }`
  })
});
<!-- +page.svelte -->
<script lang="ts">
  import { createHttpFetcher } from "@eeeooolll/graphiql";
  import GraphiQL from "@eeeooolll/graphiql/component";

  const fetcher = createHttpFetcher({ url: "/graphql" });
</script>

<GraphiQL {fetcher}/>

Yoga's /graphql endpoint speaks standard JSON; no adapter needed.

Apollo Server

// server.ts
import { ApolloServer } from "@apollo/server";
import { startStandaloneServer } from "@apollo/server/standalone";

const server = new ApolloServer({ typeDefs, resolvers });
const { url } = await startStandaloneServer(server, { listen: { port: 4000 } });
const fetcher = createHttpFetcher({
  headers: { "apollo-require-preflight": "true" },
  url: "http://localhost:4000/"
});

The apollo-require-preflight header satisfies Apollo's CSRF mitigation for non-browser clients; drop it if you disable that check.

graphql-modules

graphql-modules builds a composed schema; you still expose it over HTTP via Yoga, Apollo, or raw graphql-http. The GraphiQL wiring is identical — point the fetcher at whatever endpoint you mounted.

// modules/app.ts
import { createApplication, createModule, gql } from "graphql-modules";

const userModule = createModule({
  id: "user",
  resolvers: { Query: { me: () => ({ id: "1", name: "Ada" }) } },
  typeDefs: gql`type Query { me: User } type User { id: ID! name: String! }`
});

export const app = createApplication({ modules: [userModule] });
// server.ts (Yoga host)
import { createYoga } from "graphql-yoga";
import { app } from "./modules/app.ts";

export const yoga = createYoga({
  plugins: [app.createSubscription()],
  schema: app.createSchemaForApollo()
});
<script lang="ts">
  import { createHttpFetcher } from "@eeeooolll/graphiql";
  import GraphiQL from "@eeeooolll/graphiql/component";

  const fetcher = createHttpFetcher({ url: "/graphql" });
</script>

<GraphiQL {fetcher}/>

Hono / Bun / Deno

// deno
import { createHttpFetcher } from "@eeeooolll/graphiql";

const fetcher = createHttpFetcher({
  fetch: globalThis.fetch,
  url: "https://countries.trevorblades.com/"
});

The injectable fetch is how you plug in undici, a mocked fetch for tests, or a custom one that attaches auth headers.

Two places to set headers:

  • Per-request, server-wide — pass headers to createHttpFetcher. Applied to every request.
  • Per-tab, user-editable — use the Headers pane in the UI. Merged on top of fetcher-level headers.
const fetcher = createHttpFetcher({
  headers: { authorization: `Bearer ${token}` },
  url: "/graphql"
});

Subscriptions

SSE (graphql-sse protocol):

import { createSseFetcher, createHttpFetcher } from "@eeeooolll/graphiql";

const http = createHttpFetcher({ url: "/graphql" });
const sse = createSseFetcher({ url: "/graphql/stream" });

// Dispatch by operation type in a wrapper:
const fetcher: Fetcher = (req) => /subscription\s/.test(req.query) ? sse(req) : http(req);

WebSocket (graphql-ws protocol):

import { createWsFetcher } from "@eeeooolll/graphiql";

const ws = createWsFetcher({ url: "ws://localhost:4000/graphql" });

Either transport returns an AsyncIterable<FetcherResult>; the component handles streaming into the result pane per the subscriptionMode prop.

Custom fetcher

Anything that matches the Fetcher signature works. Useful for request batching or injecting trace headers:

import type { Fetcher } from "@eeeooolll/graphiql";

const traced: Fetcher = async (req) => {
  const traceId = crypto.randomUUID();

  const response = await fetch("/graphql", {
    body: JSON.stringify(req),
    headers: { "content-type": "application/json", "x-trace-id": traceId },
    method: "POST"
  });

  return response.json();
};

Persisted queries (APQ)

createApqFetcher implements the Apollo Automatic Persisted Queries protocol — first request sends only the SHA-256 hash; on PersistedQueryNotFound the fetcher retries with the full query and the server caches the mapping. HTTP-only.

import { createApqFetcher } from "@eeeooolll/graphiql";

const fetcher = createApqFetcher({
  url: "/graphql"
});

Pass disable: true to bypass the two-step dance (full query on every request) for debugging. Hashes are cached per-fetcher in memory; no disk persistence.

Keyboard shortcuts

Shortcut Action
Cmd/Ctrl + Enter Run query
Cmd/Ctrl + Shift + Enter New tab
Cmd/Ctrl + Shift + W Close tab
Cmd/Ctrl + Shift + F Format query
Cmd/Ctrl + Alt + Right/Left Next / prev tab

Cmd+T and Cmd+W aren't used because browsers reserve them; embedders running in Tauri/Electron can remap via matchShortcut (exported from the package).

Session export/import

import { validateSessionExport } from "@eeeooolll/graphiql";

const json = JSON.parse(rawText);
const result = validateSessionExport(json);

if ("error" in result)
  console.error(result.error);
else
  console.log(`${result.tabs.length} tabs ready to import`);

The History panel ships Export/Import buttons that round-trip through this validator. Import accepts version-1 exports, caps at 50 tabs, and rejects strings over 1 MB.

Theming

The editor theme is a separate CodeMirror Extension passed via the theme prop. Ships with lightTheme (default):

<script lang="ts">
  import { lightTheme } from "@eeeooolll/graphiql";
  import GraphiQL from "@eeeooolll/graphiql/component";
</script>

<GraphiQL {fetcher} theme={lightTheme}/>

License

MIT