Skip to main content

Comparison

Where aws-appsync-js fits in the AppSync client landscape.

Feature matrix

Featureaws-appsync-jsaws-amplifyapollo-clientHand-rolled fetch
Bundle size (gzipped)~3 KB~200 KB~40 KB~0 KB (you wrote it)
Runtime dependencies0dozensseveral0
All 5 AppSync auth modesmanualmanual
SigV4 included✅ (Node)
TypedDocumentNodepartialmanual
Discriminated auth confign/an/a
AbortSignal / timeoutsvia linkmanual
Typed error classespartialmanual
Subscriptions (WS / MQTT)🚧 planned✅ (with link)manual
Client cache / normalization❌ by designmanual
Edge-runtime friendlypartialdepends

When to pick each

aws-appsync-js

When you want a thin, typed HTTP transport for AppSync, you already have caching/state covered elsewhere (TanStack Query, SWR, Zustand, Redux Toolkit Query), and you care about bundle size or edge-runtime support.

aws-amplify

When you want batteries-included client-side cache, subscriptions, auth UI helpers, and you don't mind shipping ~200 KB. Best if you're going all-in on the Amplify ecosystem.

apollo-client (or urql)

When you want a sophisticated normalized cache and you're willing to wire up AppSync-specific auth (SigV4, API keys, etc.) yourself via links. Strong if you also talk to non-AppSync GraphQL APIs and want one client.

Hand-rolled fetch

When you have very specific requirements no library covers, or you're writing a single one-off integration and don't want a dependency. Be aware that SigV4 is genuinely subtle to get right.

Migration paths

  • From aws-amplify's GraphQL client → see Migrating from v0; the pattern is similar even though we're a different package.
  • From Apollo with a custom AppSync link → drop the link, pass your auth config to new AppSyncClient(...), and replace useQuery with whatever state library you prefer.

Bundle-size deep-dive

aws-appsync-js is ESM, sideEffects: false, and shipped tree-shaken. The numbers are measured by size-limit in CI on every PR — you can see the current threshold in the repo's .size-limit.json.

The 3 KB number includes everything: every auth mode, retries, AbortSignal composition, the introspection helper, and the error classes. There's no plugin system to "only pay for what you use" — paying for all of it is already cheap.