GraphQL Code Generator plugin for generating fully typed Apollo client queries as reactive Svelte stores. Version 1.1.0, maintained. Key differentiator: integrates Apollo's reactive system with Svelte stores, enabling auto-refetch on variable changes. Works with @graphql-codegen/cli ecosystem. Supports observable and async queries via config.
npm install graphql-codegen-svelte-apolloNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures codegen to generate Svelte Apollo stores and demonstrates reactive query usage in a component.
Pass { client } object to generated query functions explicitly.Consider migrating to observable queries or use the 'asyncQuery' config as documented.
Use the $ prefix to reactively read the store value in Svelte templates.
Ensure the file has 'export default client;' where client is new ApolloClient(...).
Use other GraphQL Codegen plugins for mutations/subscriptions.
Run npm install -D graphql-codegen-svelte-apollo and ensure plugin name matches exactly.
Pass { client } as the first argument, e.g., Transactions({ client }).Ensure clientPath points to a file exporting an ApolloClient instance.
Use $t instead of t in Svelte template.