diff --git a/src/errors.ts b/src/errors.ts index f912b05..7de2955 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -18,8 +18,10 @@ export type ClientError = export class InvalidGraphQLResponseError extends Error { response: unknown; constructor(response: unknown) { - super(`Received an invalid GraphQL response`); + super("Received an invalid GraphQL response"); + this.name = this.constructor.name; this.response = response; + Object.setPrototypeOf(this, InvalidGraphQLResponseError.prototype); } }