repo_description: The industry-leading GraphQL client for TypeScript, JavaScript, React, Vue, Angular, and more. Apollo Client delivers powerful caching, intuitive APIs, and comprehensive developer tools to accelerate your app development.
repo_topics: apollo-client apollographql graphql graphql-client typescript
code: export function isBranded(error: unknown, name: string) {
    return (
      typeof error === "object" &&
      error !== null &&
      (error as any)[Symbol.for("apollo.error")] === name
    );
  }
  
  export function brand(error: Error) {
    Object.defineProperty(error, Symbol.for("apollo.error"), {
      value: error.name,
      enumerable: false,
      writable: false,
      configurable: false,
    });
  }
  