From e4ff4938e1b79e206482f8ac66e4d91d5d616493 Mon Sep 17 00:00:00 2001 From: Alvaro Bueno Date: Thu, 16 Sep 2021 16:30:15 +0200 Subject: [PATCH 1/3] fix: add getConnectionTypeResolvers to index --- src/resolvers/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/resolvers/index.js b/src/resolvers/index.js index 460cdab123b..0b272e0e0c0 100644 --- a/src/resolvers/index.js +++ b/src/resolvers/index.js @@ -1,8 +1,10 @@ +import getConnectionTypeResolvers from "@reactioncommerce/api-utils/graphql/getConnectionTypeResolvers.js"; import Query from "./Query/index.js"; import Mutation from "./Mutation/index.js"; import Template from "./Template/index.js"; export default { + ...getConnectionTypeResolvers(Template), Query, Mutation, Template From b0cd524b8355d355d422bb27221e196464b9ce67 Mon Sep 17 00:00:00 2001 From: Mohan Narayana Date: Thu, 16 Sep 2021 13:05:09 -0500 Subject: [PATCH 2/3] fix: change getConnectionTypeResolvers parameter Signed-off-by: Mohan Narayana Signed-off-by: Alvaro Bueno --- src/resolvers/Template/index.js | 6 ------ src/resolvers/index.js | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 src/resolvers/Template/index.js diff --git a/src/resolvers/Template/index.js b/src/resolvers/Template/index.js deleted file mode 100644 index f193a8ff5e5..00000000000 --- a/src/resolvers/Template/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { encodeShopOpaqueId, encodeTemplateOpaqueId } from "../../xforms/id.js"; - -export default { - _id: (node) => encodeTemplateOpaqueId(node._id), - shopId: (node) => encodeShopOpaqueId(node.shopId) -}; diff --git a/src/resolvers/index.js b/src/resolvers/index.js index 0b272e0e0c0..b7c8f7de747 100644 --- a/src/resolvers/index.js +++ b/src/resolvers/index.js @@ -1,11 +1,9 @@ import getConnectionTypeResolvers from "@reactioncommerce/api-utils/graphql/getConnectionTypeResolvers.js"; import Query from "./Query/index.js"; import Mutation from "./Mutation/index.js"; -import Template from "./Template/index.js"; export default { - ...getConnectionTypeResolvers(Template), Query, Mutation, - Template + ...getConnectionTypeResolvers("Template") }; From f6e5927dac141d8c6ab33d6cb7ca0674da8e390a Mon Sep 17 00:00:00 2001 From: Alvaro Bueno Date: Thu, 16 Sep 2021 21:45:06 +0200 Subject: [PATCH 3/3] fix: spacing Signed-off-by: Alvaro Bueno --- src/startup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/startup.js b/src/startup.js index 78fa00d037c..9b8f2ae3eb3 100644 --- a/src/startup.js +++ b/src/startup.js @@ -12,6 +12,7 @@ export default async function emailTemplatesStartup(context) { await seedEmailTemplatesForShop(context, shop._id); }); + // Update templates if they don't already exist. const primaryShopId = await context.queries.primaryShopId(context.getInternalContext()); if (primaryShopId) {