Skip to content

Commit

Permalink
Merge pull request #40 from reactioncommerce/chore/using-context-to-c…
Browse files Browse the repository at this point in the history
…all-mutation-functions

chore: using context to call mutation functions
  • Loading branch information
brent-hoover authored Jul 6, 2022
2 parents 43707f9 + 2f32e36 commit b62a504
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: node:12.14.1
- image: node:14.18.1

dependencies:
pre:
Expand All @@ -20,7 +20,7 @@ jobs:

deploy:
docker:
- image: node:12.14.1
- image: node:14.18.1

steps:
- checkout
Expand All @@ -35,7 +35,7 @@ jobs:

lint:
docker:
- image: node:12.14.1
- image: node:14.18.1

steps:
- checkout
Expand All @@ -50,7 +50,7 @@ jobs:

test-integration:
docker:
- image: circleci/node:14.11.0-stretch
- image: circleci/node:14.18.1-stretch
# Integration tests need MongoDB server running and accessible on port 27017
- image: circleci/mongo:4.2.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
Expand All @@ -67,7 +67,7 @@ jobs:

lint-graphql:
docker:
- image: node:12.14.1
- image: node:14.18.1

steps:
- checkout
Expand All @@ -82,7 +82,7 @@ jobs:

test:
docker:
- image: node:12.14.1
- image: node:14.18.1

steps:
- checkout
Expand Down
3 changes: 1 addition & 2 deletions src/resolvers/Mutation/createSurcharge.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { decodeFulfillmentMethodOpaqueId, decodeShopOpaqueId } from "../../xforms/id.js";
import createSurchargeMutation from "../../mutations/createSurcharge.js";

/**
* @name Mutation/createSurcharge
Expand All @@ -26,7 +25,7 @@ export default async function createSurcharge(parentResult, { input }, context)

surcharge.methodIds = decodedMethodIds;

const { surcharge: insertedSurcharge } = await createSurchargeMutation(context, {
const { surcharge: insertedSurcharge } = await context.mutations.createSurcharge(context, {
surcharge,
shopId
});
Expand Down
3 changes: 1 addition & 2 deletions src/resolvers/Mutation/deleteSurcharge.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { decodeShopOpaqueId, decodeSurchargeOpaqueId } from "../../xforms/id.js";
import deleteSurchargeMutation from "../../mutations/deleteSurcharge.js";

/**
* @name Mutation/deleteSurcharge
Expand All @@ -20,7 +19,7 @@ export default async function deleteSurcharge(parentResult, { input }, context)
const shopId = decodeShopOpaqueId(opaqueShopId);
const surchargeId = decodeSurchargeOpaqueId(opaqueSurchargeId);

const { surcharge } = await deleteSurchargeMutation(context, {
const { surcharge } = await context.mutations.deleteSurcharge(context, {
surchargeId,
shopId
});
Expand Down
3 changes: 1 addition & 2 deletions src/resolvers/Mutation/updateSurcharge.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { decodeFulfillmentMethodOpaqueId, decodeShopOpaqueId, decodeSurchargeOpaqueId } from "../../xforms/id.js";
import updateSurchargeMutation from "../../mutations/updateSurcharge.js";

/**
* @name Mutation/updateSurcharge
Expand Down Expand Up @@ -28,7 +27,7 @@ export default async function updateSurcharge(parentResult, { input }, context)

surcharge.methodIds = decodedMethodIds;

const { surcharge: updatedSurcharge } = await updateSurchargeMutation(context, {
const { surcharge: updatedSurcharge } = await context.mutations.updateSurcharge(context, {
surcharge,
surchargeId,
shopId
Expand Down

0 comments on commit b62a504

Please sign in to comment.