docs: framework support guide (Vue, Svelte, Astro) + example - #414
Closed
JoviDeCroock wants to merge 1 commit into
Closed
docs: framework support guide (Vue, Svelte, Astro) + example#414JoviDeCroock wants to merge 1 commit into
JoviDeCroock wants to merge 1 commit into
Conversation
Documents where GraphQLSP can and cannot run outside plain .ts files, backed by research into each framework's language tooling: - Vue: works inside .vue SFCs via Vue Language Tools hybrid mode (@vue/typescript-plugin in tsserver); verified headlessly over the raw tsserver protocol (diagnostics, hover, completions) - Svelte: .ts files only; svelte-language-server does not load tsconfig TS plugins for .svelte files (sveltejs/language-tools#905) - Astro: .ts files only; the Volar-based Astro language server ignores compilerOptions.plugins (withastro/astro#16917, closed as not planned) Adds packages/example-vue, a minimal gql.tada + GraphQLSP Vue project mirroring packages/example-tada. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / Why
Users keep asking whether GraphQLSP works in non-
.tsfiles — Astro (#242), Svelte(Kit) (#251, closed as duplicate of #168), and Vue. Since GraphQLSP is atsserverplugin, the answer depends entirely on whether each framework's language tooling routes its single-file components throughtsserver(wheretsconfig.jsonplugins load) or through its own language server (where they don't).This PR adds a Framework support section to the README documenting the current state per framework, plus a minimal working Vue example package (
packages/example-vue, modeled onpackages/example-tada). Docs + private example packages only — no changeset needed,packages/graphqlspis untouched.Research findings (with sources)
Vue — supported. Vue Language Tools serves TypeScript features for
.vuefiles through the regulartsserverrunning@vue/typescript-plugin("hybrid mode"); as of v3 this is the only mode — the Vue language server no longer handles TypeScript itself (upgrade guide, vuejs/language-tools#5456). Because Volar maps positions between the SFC and its virtual TS at thetsserverboundary, GraphQLSP (declared intsconfig.jsonplugins) participates in.vuescript blocks with correctly mapped positions. Note this supersedes the current gql.tada docs statement that the TS plugin "won't be able to run in your editor under normal circumstances" for.vuefiles.Svelte —
.tsfiles only.svelte-language-serverhandles.sveltefiles itself and does not load external TS plugins;typescript-svelte-pluginonly teachestsserverabout.svelteimports from.tsfiles and deliberately returns no diagnostics for.sveltefiles. External TS plugin support is a still-open feature request from 2021 labeled "limitation": sveltejs/language-tools#905. See also the history in #168/#251.gql-tada check+@gql.tada/svelte-supportcovers.sveltedocuments on the CLI.Astro —
.astrofiles not supported. The Volar-based Astro language server (now in the Astro monorepo) type-checks.astrofrontmatter in its own server and ignorescompilerOptions.plugins. Both requests to change this were closed as not planned: withastro/language-tools#991 (repo since archived) and withastro/astro#16917 (May 2026)..tsfiles in Astro projects work as usual.What was verified vs not
Verified headlessly in this workspace:
tsserver --globalPlugins @vue/typescript-plugin(exactly how the Vue VS Code extension / vtsls load it) againstpackages/example-vue, openedsrc/Pokemon.vuewith a deliberate schema typo:52001Cannot query field "fleeRatee" on type "Pokemon". Did you mean "fleeRate"?reported at the correct.vueline/columnPokemon.name: String!maxCP,maxHP,id)@vue/typescript-plugin@3.3.6, TypeScript 5.3.3, vue 3.5.39vue-tsc --noEmitpasses on the example; with the typo present it still passes (confirming CLI type checks don't run LS plugins), whilegql-tada check(with@gql.tada/vue-support) correctly reports the same error atsrc/Pokemon.vue:10:7pnpm installsucceeds with the new package;pnpm --filter @0no-co/graphqlsp run buildand the fullpnpm run test:e2esuite pass (52/52)NOT verified (no editor available headlessly):
Side note:
gql-tada checkcrashes withTypeError: t.unref is not a functionin@gql.tada/cli-utils@1.9.0cleanup on Node 22 after printing correct results — unrelated to this PR, may be worth an upstream look.Follow-up proposals (not implemented here)
tsserverplugins for their SFC formats. A GraphQLSP-side shim can't inject itself into those servers. If desired, the realistic follow-ups are upstream contributions (a VolargetExternalFiles-style plugin bridge in svelte-language-server per Use external typescript-plugin for IntelliSense within svelte files sveltejs/language-tools#905, orcompilerOptions.pluginsinitialization in Astro's language server per Support compilerOptions.plugins inside Astro Language Server (Breaks TS Language plugins) withastro/astro#16917), plus documentinggql-tada checksupport packages as the CI story.--globalPlugins @vue/typescript-plugin) in CI to catch regressions in the Volar interop; left out to keep this PR docs/example-only.🤖 Generated with Claude Code