Skip to content

v3.3.0

Compare
Choose a tag to compare
@logaretm logaretm released this 16 Dec 21:05
· 17 commits to main since this release

πŸ†• New Features

Added useQuery data mappers. Similar to subscriptions, you can now pass a second argument to useQuery to map the data and it will be fully typed.

const { data, error } = useQuery(
  {
    query: new TypedDocumentString<{ posts: Post[] }, never>(`
    query Posts {
      posts {
        id
        title
      }
    }
  `),
  },
  ({ data }) => {
    return data?.posts.map(p => p.id) || [];
  },
);

data.value;
//^ number[]

πŸ‘• TypeScript

  • Exported mutation execution options type #203 thanks to @jbaubree