Skip to main content

One post tagged with "GraphQL"

View All Tags

GraphQL in HyperFetch 10

· 9 min read
Maciej Pyrc
Creator of Hyper Fetch | @BetterTyped
Feature

GraphQL in HyperFetch 10

Typed documents, persisted queries and subscriptions.

user.ts×
const getUser = client.createRequest()({
endpoint: GetUserDocument, // typed by graphql-codegen or gql.tada
options: { persistedQueries: true },
});

const { data } = await getUser.send({ payload: { id: "1" } });

Your GraphQL documents already know their result and variables types. HyperFetch 10 reads them straight from the document, sends hashes instead of full queries, keeps partial data when you want it, refetches every variant of an operation after a mutation, and listens to subscriptions over graphql-ws.