diff --git a/src/lib/stitching/exchange/__tests__/stitching.test.ts b/src/lib/stitching/exchange/__tests__/stitching.test.ts index 4afa1c32b8..47336250d6 100644 --- a/src/lib/stitching/exchange/__tests__/stitching.test.ts +++ b/src/lib/stitching/exchange/__tests__/stitching.test.ts @@ -137,7 +137,7 @@ it("delegates to the local schema for an Order's creditCard", async () => { expect(mergeInfo.delegateToSchema).toHaveBeenCalledWith({ args: { id: "CC-1" }, - fieldName: "credit_card", + fieldName: "creditCard", ...restOfResolveArgs, }) }) @@ -151,7 +151,7 @@ it("doesn't delegate to the local schema for an Order's creditCard if creditCard expect(mergeInfo.delegateToSchema).not.toHaveBeenCalledWith({ args: { id: null }, - fieldName: "credit_card", + fieldName: "creditCard", ...restOfResolveArgs, }) }) diff --git a/src/lib/stitching/exchange/__tests__/testingUtils.ts b/src/lib/stitching/exchange/__tests__/testingUtils.ts index d5dbee7e4b..4e0957701b 100644 --- a/src/lib/stitching/exchange/__tests__/testingUtils.ts +++ b/src/lib/stitching/exchange/__tests__/testingUtils.ts @@ -1,8 +1,8 @@ import { mergeSchemas } from "graphql-tools" -import { exchangeStitchingEnvironment } from "../v1/stitching" +import { exchangeStitchingEnvironment } from "../v2/stitching" import { GraphQLSchema } from "graphql" import { executableExchangeSchema, transformsForExchange } from "../schema" -import localSchema from "schema/v1/schema" +import localSchema from "schema/v2/schema" let cachedSchema: GraphQLSchema & { transforms: any } let stitchedSchema: ReturnType diff --git a/src/lib/stitching/exchange/v2/stitching.ts b/src/lib/stitching/exchange/v2/stitching.ts index faac6d695f..9f873f7135 100644 --- a/src/lib/stitching/exchange/v2/stitching.ts +++ b/src/lib/stitching/exchange/v2/stitching.ts @@ -366,8 +366,9 @@ export const exchangeStitchingEnvironment = ({ try { await conversationLoader(impulseConversationId) } catch (e) { - // be more elegant? - throw new GraphQLError(`Bad Request`) + throw new GraphQLError( + `[metaphysics @ exchange/v2/stitching] Conversation not found` + ) } const offerResult = await info.mergeInfo.delegateToSchema({ @@ -415,7 +416,9 @@ export const exchangeStitchingEnvironment = ({ } = orderOrError if (!orderId) { - throw new GraphQLError("Bad request (no order id)") + throw new GraphQLError( + "[metaphysics @ exchange/v2/stitching] Order.orderID field must be selected" + ) } try { @@ -425,7 +428,7 @@ export const exchangeStitchingEnvironment = ({ }) } catch (e) { throw new GraphQLError( - "Impulse: request to associate offer with conversation failed" + "[metaphysics @ exchange/v2/stitching] Impulse: request to associate offer with conversation failed" ) } }