Setup
import { ApiClient } from "@tahanabavi/typefetch";
import { graphqlTransport } from "@tahanabavi/typefetch-graphql";
import { contracts } from "./contracts";
const client = new ApiClient(
{
baseUrl: "https://api.example.com",
transports: [
graphqlTransport({ url: "https://api.example.com/graphql" }),
],
},
contracts,
);
client.init();Installing the package is what makes transport: "graphql" compile — it augments
typefetch's TransportRegistry. Registering it explicitly is what keeps a
REST-only bundle from paying for it.