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 460cdab123b..b7c8f7de747 100644 --- a/src/resolvers/index.js +++ b/src/resolvers/index.js @@ -1,9 +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 { Query, Mutation, - Template + ...getConnectionTypeResolvers("Template") }; 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) {