v3.0.0
Major Changes
-
153146a: Move the React provider/hook exports to a dedicated
./reactentry so the package root is framework-neutral.The root entry previously re-exported the React providers, which call
createContextat module load. Because the bundle is not code-split, importing anything from the root (even the plainGraphQLFetcherErrorclass or a type) evaluatedcreateContext— which crashes in React Server Components (createContext is not a function). The root entry is now React-free and safe to import in RSC / server code; the providers live in./react(marked"use client").Breaking change — migrate provider/hook imports:
- import { ClientGqlFetcherProvider, useClientGqlFetcher } from "@labdigital/graphql-fetcher"; + import { ClientGqlFetcherProvider, useClientGqlFetcher } from "@labdigital/graphql-fetcher/react";
This also applies to
StrictClientGqlFetcherProvideranduseStrictClientGqlFetcher. All other exports —initClientFetcher,initStrictClientFetcher,GraphQLFetcherError, and every type (GqlResponse,GraphQLError,OnGraphQLErrors,OnRequestError,RetryOptions, …) — remain on the package root. The./serverentry is unchanged.