releases.shpreview
Vercel/SWR/1.1.0

1.1.0

November 30, 2021SWRView original ↗
$npx -y @buildinternet/releases show rel__mHvLj81bII6bBkrbS_-U

Highlights for This Release

1. Built-in & stable serialization for SWR keys

useSWR({ query: graphql`...`, variables }, fetcher)
useSWR({ query: graphql`...`, variables }, fetcher)
useSWR({ variables, query: graphql`...` }, fetcher)
// ^all recognized as the same resource

For array keys too, it's safe to do the following:

useSWR([ `...`, { variables } ], fetcher)

2. revalidateFirstPage for useSWRInfinite

This is a new added option for useSWRInfinite (defaults to true), you can use it to control if the first page should be revalidated when changing the size or doing a mutation.

3. Better TypeScript support

  • Key / arguments
  • Conditional / dependent
  • Constant keys
  • Returned data

image

What's Changed

New Contributors

Full Changelog: https://github.com/vercel/swr/compare/1.0.1...1.1.0

Fetched April 18, 2026