A <512 byte zero-dependency library that transforms GraphQL responses by replacing errored fields with throwing getters. Version 1.0.0 stable. It solves the ambiguous `null` problem in GraphQL by throwing when you access a field that errored, allowing natural error handling with try/catch or React ErrorBoundary. Works with any GraphQL client (Apollo, URQL, fetch) that returns `{ data, errors }` — unlike Relay which has native directives. Ships TypeScript types, supports ESM and CJS.
npm install graphql-toeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use toe() to transform a GraphQL response and handle errors via try/catch.
Always ensure the GraphQL response has a data field. Use try/catch around toe() to handle missing data.
For ambiguous nulls, verify that errors array contains a matching path. Consider preprocessing errors if needed.
Wrap the error object in an Error or GraphQLError before calling toe(), or add your own error handling.
N/A
If you need to preserve the original response, deep-clone before calling toe().
Run 'npm install graphql-toe' and ensure import is 'graphql-toe' not 'graphql-toe/dist' or similar.
Change 'import toe from "graphql-toe"' to 'import { toe } from "graphql-toe"'.Use ESM import syntax: 'import { toe } from "graphql-toe"'.No dependency data recorded yet.