A utility that recursively removes all __typename properties from GraphQL responses. Version 1.0.2 provides a single pure function that walks through objects and arrays and deletes any key named __typename. It ships with TypeScript types and is released as a stable package. Compared to alternatives like apollo's removeTypenameFromVariables, this package focuses solely on responses and does not modify the original object. It is a zero-dependency, lightweight solution for cleaning up Apollo Client or Relay responses before caching or serializing. The package is maintained with weekly downloads in the low thousands and an MIT license.
npm install remove-graphql-typenameNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates recursively removing __typename from a GraphQL response object.
If you need deep immutability, consider using JSON.parse(JSON.stringify(data)) before calling removeTypename.
Ensure your data uses the exact key '__typename'. If you have variations, you may need a custom solution.
Use 'import removeTypename from 'remove-graphql-typename'' or 'const removeTypename = require('remove-graphql-typename')'Ensure the argument is an object or array. Check: if (data) removeTypename(data);
No dependency data recorded yet.