Skip to content

Commit

Permalink
simulate GraphQL error, not network error
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Apr 17, 2024
1 parent 902a598 commit c8a2ad5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import type {
} from "./DataTransportAbstraction.js";
import { bundle } from "../bundleInfo.js";
import { serializeOptions, deserializeOptions } from "./transportedOptions.js";
import { GraphQLError } from "graphql";

function getQueryManager<TCacheShape>(
client: OrigApolloClient<unknown>
Expand Down Expand Up @@ -228,7 +229,9 @@ export class ApolloClientClientBaseImpl<
"Query failed upstream, we will fail it during SSR and rerun it in the browser:",
queryInfo.options
);
queryInfo?.reject?.(new Error("Query failed upstream."));
queryInfo?.resolve?.({
errors: [new GraphQLError("Query failed upstream.")],
});
}
}
this.transportedQueryOptions.delete(event.id);
Expand Down

0 comments on commit c8a2ad5

Please sign in to comment.