From 3f8b5d724cee2a746a550fcedbc5c60375f100e0 Mon Sep 17 00:00:00 2001 From: alessia Date: Wed, 9 Nov 2022 13:44:35 -0500 Subject: [PATCH 1/3] chore: test mutation with defer --- CRA-demo/src/index.js | 7 ++ CRA-demo/src/pages/purchase.js | 78 +++++++++++++++ scripts/docker-compose.router.yml | 5 +- scripts/subgraphs.sh | 4 +- scripts/subgraphs/users/Dockerfile | 12 +++ scripts/subgraphs/users/package.json | 20 ++++ scripts/subgraphs/users/users.graphql | 53 ++++++++++ scripts/subgraphs/users/users.js | 137 ++++++++++++++++++++++++++ scripts/supergraph.graphql | 66 ++++++++++++- scripts/supergraph.yaml | 4 + 10 files changed, 381 insertions(+), 5 deletions(-) create mode 100644 CRA-demo/src/pages/purchase.js create mode 100644 scripts/subgraphs/users/Dockerfile create mode 100644 scripts/subgraphs/users/package.json create mode 100644 scripts/subgraphs/users/users.graphql create mode 100644 scripts/subgraphs/users/users.js diff --git a/CRA-demo/src/index.js b/CRA-demo/src/index.js index ce6f442..0a36863 100644 --- a/CRA-demo/src/index.js +++ b/CRA-demo/src/index.js @@ -21,6 +21,9 @@ import ErrorNonNullableInDeferredFragment from "./pages/errorNonNullableInDeferr import ErrorNonNullableOutsideDeferredFragment from "./pages/errorNonNullableOutsideDeferredFragment"; import ErrorTopLevelQueryField from "./pages/errorTopLevelQueryField"; +// mutation testing +import PurchasePage from "./pages/purchase"; + const root = ReactDOM.createRoot(document.getElementById("root")); root.render( @@ -75,6 +78,10 @@ root.render( path="/error-top-level-query-field" element={} /> + } + /> diff --git a/CRA-demo/src/pages/purchase.js b/CRA-demo/src/pages/purchase.js new file mode 100644 index 0000000..b6e8d7c --- /dev/null +++ b/CRA-demo/src/pages/purchase.js @@ -0,0 +1,78 @@ +import { gql } from "@apollo/client"; +import { useMutation } from "@apollo/client"; + +const Loading = () => { + return ( +
+ + Loading... +
+ ); +}; + +const USER_QUERY = gql` + mutation ($userId: ID!, $paymentInformation: PaymentInformationInput!) { + makePayment(userId: $userId, paymentInformation: $paymentInformation) { + id + ... @defer { + paymentStatus { + __typename + id + ... on PaymentSuccess { + billedAmount + } + ... on PaymentFailed { + reason + } + } + } + } + } +`; + +const variables = { + userId: "1", + paymentInformation: { + fakeInfo: "demo", + }, +}; + +const MakePayment = () => { + const [makePayment, { data, loading, error }] = useMutation(USER_QUERY); + console.log(data, loading, error); + + if (loading) { + return ; + } else if (error) { + return
error.message
; + } + return ( +
+ {!data && !loading && ( + <> + + + )} + {data && <>{JSON.stringify(data)}} +
+ ); +}; + +export default MakePayment \ No newline at end of file diff --git a/scripts/docker-compose.router.yml b/scripts/docker-compose.router.yml index b67313d..3578ade 100644 --- a/scripts/docker-compose.router.yml +++ b/scripts/docker-compose.router.yml @@ -19,4 +19,7 @@ services: - "4000:4000" products: container_name: products - build: ./subgraphs/products \ No newline at end of file + build: ./subgraphs/products + users: + container_name: users + build: ./subgraphs/users \ No newline at end of file diff --git a/scripts/subgraphs.sh b/scripts/subgraphs.sh index ff5997e..a97571a 100644 --- a/scripts/subgraphs.sh +++ b/scripts/subgraphs.sh @@ -1,7 +1,9 @@ #!/bin/bash -subgraphs=("products") +subgraphs=("products" "users") url_products="http://products:4000/graphql" +url_users="http://users:4000/graphql" schema_products="subgraphs/products/products.graphql" +schema_users="subgraphs/users/users.graphql" \ No newline at end of file diff --git a/scripts/subgraphs/users/Dockerfile b/scripts/subgraphs/users/Dockerfile new file mode 100644 index 0000000..304da89 --- /dev/null +++ b/scripts/subgraphs/users/Dockerfile @@ -0,0 +1,12 @@ +FROM node:18-bullseye + +WORKDIR /usr/src/app + +COPY package.json . + +RUN npm install + +COPY users.js . +COPY users.graphql . + +CMD [ "node", "users.js" ] diff --git a/scripts/subgraphs/users/package.json b/scripts/subgraphs/users/package.json new file mode 100644 index 0000000..6efd1cc --- /dev/null +++ b/scripts/subgraphs/users/package.json @@ -0,0 +1,20 @@ +{ + "name": "subgraph-users", + "version": "1.1.21", + "description": "", + "main": "users.js", + "scripts": { + "start": "node users.js" + }, + "dependencies": { + "@apollo/subgraph": "2.1.1", + "apollo-server": "3.10.2", + "@faker-js/faker": "^7.6.0", + "supergraph-demo-opentelemetry": "0.2.4", + "graphql": "16.6.0", + "uuid": "^9.0.0" + }, + "keywords": [], + "author": "", + "license": "MIT" +} \ No newline at end of file diff --git a/scripts/subgraphs/users/users.graphql b/scripts/subgraphs/users/users.graphql new file mode 100644 index 0000000..92cab7f --- /dev/null +++ b/scripts/subgraphs/users/users.graphql @@ -0,0 +1,53 @@ +extend schema + @link( + url: "https://specs.apollo.dev/federation/v2.0" + import: ["@key", "@shareable", "@tag", "@inaccessible"] + ) + +type Query { + user(id: ID!): PaymentUser! + getPaymentStatus: PaymentStatus! + users: [PaymentUser!]! +} + +type PaymentUser { + id: ID! + name: String! + email: String + username: String! + friends(first: Int = 10, after: Int = 0): [PaymentUser!] + phoneNumber: String + title: String + avatarUrl: String +} + +type Mutation { + makePayment( + userId: ID! + paymentInformation: PaymentInformationInput! + ): MakePaymentResult! +} + +input PaymentInformationInput { + fakeInfo: String! +} + +type MakePaymentResult { + id: ID! + user: PaymentUser! + paymentStatus: PaymentStatus +} + +interface PaymentStatus { + id: ID! +} + +type PaymentSuccess implements PaymentStatus { + id: ID! + billedAmount: Float! +} + +type PaymentFailed implements PaymentStatus { + id: ID! + reason: String! +} diff --git a/scripts/subgraphs/users/users.js b/scripts/subgraphs/users/users.js new file mode 100644 index 0000000..805d5c9 --- /dev/null +++ b/scripts/subgraphs/users/users.js @@ -0,0 +1,137 @@ +const { v4: uuidv4 } = require("uuid"); +const { faker } = require("@faker-js/faker") +const { randomUUID } = require("crypto"); + +// Open Telemetry (optional) +const { ApolloOpenTelemetry } = require("supergraph-demo-opentelemetry"); + +if (process.env.APOLLO_OTEL_EXPORTER_TYPE) { + new ApolloOpenTelemetry({ + type: "subgraph", + name: "users", + exporter: { + type: process.env.APOLLO_OTEL_EXPORTER_TYPE, // console, zipkin, collector + host: process.env.APOLLO_OTEL_EXPORTER_HOST, + port: process.env.APOLLO_OTEL_EXPORTER_PORT, + }, + }).setupInstrumentation(); +} + +const { ApolloServer, gql } = require("apollo-server"); +const { buildSubgraphSchema } = require("@apollo/subgraph"); +const { readFileSync } = require("fs"); + +const port = process.env.APOLLO_PORT || 4000; + + +//////////////////////// +// generate fake data // +//////////////////////// + +const generateUsers = (numberOfUsers) => { + faker.seed(1234 * numberOfUsers); + const users = []; + for (let i = 0; i < numberOfUsers; i++) { + let fn = faker.name.firstName(); + let ln = faker.name.lastName(); + users.push({ + id: randomUUID(), + name: faker.name.fullName({ firstName: fn, lastName: ln }), + email: faker.internet.exampleEmail(fn, ln), + username: faker.internet.userName(fn, ln), + phoneNumber: faker.phone.number(), + title: faker.name.jobTitle(), + avatarUrl: faker.internet.avatar(), + }); + } + return users; +}; + +const getSpecificUser = (id) => { + faker.seed(5678); + let fn = faker.name.firstName(); + let ln = faker.name.lastName(); + return { + id, + name: faker.name.fullName({ firstName: fn, lastName: ln }), + email: faker.internet.exampleEmail(fn, ln), + username: faker.internet.userName(fn, ln), + phoneNumber: faker.phone.number(), + title: faker.name.jobTitle(), + }; +}; + +const wait = async (time) => { + return new Promise((res) => { + setTimeout(res, time); + }); +}; + +const typeDefs = gql(readFileSync("./users.graphql", { encoding: "utf-8" })); + +const resolvers = { + Query: { + users: (p, a, c, i) => { + return generateUsers(5); + }, + user: (p, a, c, i) => { + return getSpecificUser(a.userId); + }, + }, + Mutation: { + makePayment: (p, a, c, i) => { + let u = getSpecificUser(a.userId); + return { + id: uuidv4(), + user: u, + }; + }, + }, + User: { + friends: async (p, a, c, i) => { + console.log(a); + await wait(a.first * 100); + return generateUsers(4); + }, + }, + MakePaymentResult: { + paymentStatus: async (p, a, c, i) => { + let pseudoRandom = Math.floor(Math.random() * 100); + await wait(100 * 10); + if (pseudoRandom % 2 === 0) { + return { + id: uuidv4(), + billedAmount: Math.random() * 100 + Math.random(), + }; + } else { + return { + id: uuidv4(), + reason: "bad payment info", + }; + } + }, + }, + PaymentStatus: { + __resolveType: (o, c, i) => { + if (o.billedAmount) { + return "PaymentSuccess"; + } + if (o.reason) { + return "PaymentFailed"; + } + return null; + }, + }, +}; + +const server = new ApolloServer({ + schema: buildSubgraphSchema({ typeDefs, resolvers }), +}); +server + .listen({ port: port }) + .then(({ url }) => { + console.log(`🚀 Users subgraph ready at ${url}`); + }) + .catch((err) => { + console.error(err); + }); \ No newline at end of file diff --git a/scripts/supergraph.graphql b/scripts/supergraph.graphql index a0632b5..b4ad322 100644 --- a/scripts/supergraph.graphql +++ b/scripts/supergraph.graphql @@ -1,4 +1,3 @@ - schema @link(url: "https://specs.apollo.dev/link/v1.0") @link(url: "https://specs.apollo.dev/join/v0.2", for: EXECUTION) @@ -6,6 +5,7 @@ schema @link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY) { query: Query + mutation: Mutation } directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION @@ -26,6 +26,7 @@ scalar join__FieldSet enum join__Graph { PRODUCTS @join__graph(name: "products", url: "http://products:4000/graphql") + USERS @join__graph(name: "users", url: "http://users:4000/graphql") } scalar link__Import @@ -42,6 +43,61 @@ enum link__Purpose { EXECUTION } +type MakePaymentResult + @join__type(graph: USERS) +{ + id: ID! + user: PaymentUser! + paymentStatus: PaymentStatus +} + +type Mutation + @join__type(graph: USERS) +{ + makePayment(userId: ID!, paymentInformation: PaymentInformationInput!): MakePaymentResult! +} + +type PaymentFailed implements PaymentStatus + @join__implements(graph: USERS, interface: "PaymentStatus") + @join__type(graph: USERS) +{ + id: ID! + reason: String! +} + +input PaymentInformationInput + @join__type(graph: USERS) +{ + fakeInfo: String! +} + +interface PaymentStatus + @join__type(graph: USERS) +{ + id: ID! +} + +type PaymentSuccess implements PaymentStatus + @join__implements(graph: USERS, interface: "PaymentStatus") + @join__type(graph: USERS) +{ + id: ID! + billedAmount: Float! +} + +type PaymentUser + @join__type(graph: USERS) +{ + id: ID! + name: String! + email: String + username: String! + friends(first: Int = 10, after: Int = 0): [PaymentUser!] + phoneNumber: String + title: String + avatarUrl: String +} + type Product implements ProductItf & SkuItf @join__implements(graph: PRODUCTS, interface: "ProductItf") @join__implements(graph: PRODUCTS, interface: "SkuItf") @@ -96,9 +152,13 @@ type ProductVariation type Query @join__type(graph: PRODUCTS) + @join__type(graph: USERS) { - allProducts: [ProductItf] - product(id: ID!): ProductItf + allProducts: [ProductItf] @join__field(graph: PRODUCTS) + product(id: ID!): ProductItf @join__field(graph: PRODUCTS) + user(id: ID!): PaymentUser! @join__field(graph: USERS) + getPaymentStatus: PaymentStatus! @join__field(graph: USERS) + users: [PaymentUser!]! @join__field(graph: USERS) } interface SkuItf diff --git a/scripts/supergraph.yaml b/scripts/supergraph.yaml index 70f1da2..d566b92 100644 --- a/scripts/supergraph.yaml +++ b/scripts/supergraph.yaml @@ -4,3 +4,7 @@ subgraphs: routing_url: http://products:4000/graphql schema: file: subgraphs/products/products.graphql + users: + routing_url: http://users:4000/graphql + schema: + file: subgraphs/users/users.graphql \ No newline at end of file From 572f0681b6f27f56ebb05443274f5f352920981c Mon Sep 17 00:00:00 2001 From: alessia Date: Wed, 4 Jan 2023 15:29:17 -0500 Subject: [PATCH 2/3] chore: add mutation test --- CRA-demo/cypress/e2e/defer.cy.js | 30 +-- CRA-demo/package-lock.json | 263 ++++++++++++++++--------- CRA-demo/package.json | 10 +- CRA-demo/src/index.js | 9 +- CRA-demo/src/pages/deferredMutation.js | 53 +++++ CRA-demo/src/pages/purchase.js | 78 -------- scripts/docker-compose.router.yml | 2 +- 7 files changed, 252 insertions(+), 193 deletions(-) create mode 100644 CRA-demo/src/pages/deferredMutation.js delete mode 100644 CRA-demo/src/pages/purchase.js diff --git a/CRA-demo/cypress/e2e/defer.cy.js b/CRA-demo/cypress/e2e/defer.cy.js index 0f626bb..679e7f5 100644 --- a/CRA-demo/cypress/e2e/defer.cy.js +++ b/CRA-demo/cypress/e2e/defer.cy.js @@ -18,7 +18,6 @@ describe("@defer tests", () => { // for the deferred query, we can see the sku + id (fast fields) // already rendered... // and after waiting >2s the deferred fields are present - cy.findByText(/loading/i).should("exist"); cy.findByText(/apollo-federation/i, { timeout: 1000 }).should("exist"); cy.findByText(/variation: oss - platform/i).should("not.exist"); cy.wait(3000); @@ -40,7 +39,6 @@ describe("@defer tests", () => { // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L271 it("Can defer a fragment within an already deferred fragment", () => { cy.visit("/nested-deferred-fragments"); - cy.findByText(/loading/i).should("exist"); cy.findByText(/apollo-federation/i, { timeout: 1000 }).should("exist"); cy.findByText(/apollo-studio/i).should("exist"); // because of nested @defer directives, @@ -54,7 +52,6 @@ describe("@defer tests", () => { // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L398 it("Can defer an inline fragment", () => { cy.visit("/defer-inline-fragment"); - cy.findByText(/loading/i).should("exist"); cy.findByText(/apollo-federation/i, { timeout: 1000 }).should("exist"); cy.findByText(/variation: oss - platform/i).should("not.exist"); cy.wait(3000); @@ -102,15 +99,15 @@ describe("@defer tests", () => { // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L460 it("Handles non-nullable errors thrown in deferred fragments", () => { cy.visit("/error-non-nullable-in-deferred-fragment"); - cy.findByText(/loading/i).should("exist"); cy.findByText(/Error :\(/i).should("exist"); cy.findAllByText(/apollo-federation/i).should("exist"); cy.findAllByText(/apollo-studio/i).should("exist"); cy.findAllByText(/apollo-client/i).should("exist"); }); + // Skipping until AC bug https://github.com/apollographql/apollo-client/issues/10406 is resolved // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L497 - it("Handles non-nullable errors thrown outside deferred fragments", () => { + it.skip("Handles non-nullable errors thrown outside deferred fragments", () => { cy.visit("/error-non-nullable-outside-deferred-fragment"); cy.findByText(/loading/i).should("exist"); cy.findByText(/Error :\(/i).should("exist"); @@ -120,7 +117,6 @@ describe("@defer tests", () => { // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L167 it("Does not disable defer with null if argument", () => { cy.visit("/disable-defer-null-if"); - cy.findByText(/loading/i).should("exist"); cy.findByText(/apollo-federation/i, { timeout: 1000 }).should("exist"); cy.findByText(/variation: oss - platform/i).should("not.exist"); cy.wait(3000); @@ -130,7 +126,6 @@ describe("@defer tests", () => { // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L196 it("Can defer fragments on the top level Query field", () => { cy.visit("/defer-top-level-query-field"); - cy.findByText(/loading/i).should("exist"); cy.wait(2000); cy.findByText(/apollo-federation/i, { timeout: 1 }).should("not.exist"); cy.wait(1500); @@ -149,10 +144,19 @@ describe("@defer tests", () => { // router issue: https://github.com/apollographql/router/issues/1834 // https://github.com/graphql/graphql-js/blob/a24a9f35b876bdd0d5050eca34d3020bd0db9a29/src/execution/__tests__/defer-test.ts#L529 - // it("Handles async non-nullable errors thrown in deferred fragments", () => { - // cy.visit("/error-async-non-nullable-in-deferred-fragment"); - // cy.findByText(/loading/i).should("exist"); - // cy.findByText(/Error :\(/i).should("exist"); - // cy.findAllByText(/apollo-federation/i).should("not.exist"); - // }); + it("Handles async non-nullable errors thrown in deferred fragments", () => { + cy.visit("/error-async-non-nullable-in-deferred-fragment"); + cy.findByText(/Error :\(/i).should("exist"); + cy.findAllByText(/apollo-federation/i).should("exist"); + cy.findAllByText(/apollo-studio/i).should("exist"); + cy.findAllByText(/apollo-client/i).should("exist"); + }); + + it("Renders the entire response from a mutation containing @defer after the last chunk is returned", () => { + cy.visit("/deferred-mutation"); + cy.findByText(/loading/i).should("not.exist"); + cy.findByRole('button', {name: /make payment/i}).click(); + cy.findByText(/loading/i).should("exist"); + cy.findByText(/"__typename":"MakePaymentResult"/i).should("exist"); + }); }); diff --git a/CRA-demo/package-lock.json b/CRA-demo/package-lock.json index a6edb0c..fed21a8 100644 --- a/CRA-demo/package-lock.json +++ b/CRA-demo/package-lock.json @@ -8,19 +8,34 @@ "name": "router-defer-e2e-tests", "version": "0.1.0", "dependencies": { +<<<<<<< HEAD "@apollo/client": "3.7.2", "graphql": "16.6.0", "react": "18.2.0", "react-dom": "18.2.0", "react-router-dom": "6.4.4", +======= + "@apollo/client": "3.7.3", + "graphql": "16.6.0", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-router-dom": "6.6.1", +>>>>>>> 5434e50 (chore: add mutation test) "react-scripts": "5.0.1", "web-vitals": "3.1.0" }, "devDependencies": { +<<<<<<< HEAD "@testing-library/cypress": "8.0.7", "cypress": "11.2.0", "eslint-plugin-cypress": "2.12.1", "start-server-and-test": "1.15.0" +======= + "@testing-library/cypress": "9.0.0", + "cypress": "12.3.0", + "eslint-plugin-cypress": "2.12.1", + "start-server-and-test": "1.15.2" +>>>>>>> 5434e50 (chore: add mutation test) } }, "node_modules/@ampproject/remapping": { @@ -36,9 +51,15 @@ } }, "node_modules/@apollo/client": { +<<<<<<< HEAD "version": "3.7.2", "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.2.tgz", "integrity": "sha512-ohAIpXl3mTa1Fd3GT/K37VwQJfTIuuJRp4aOlJ4q/hlx0Wxh+RqDrbn0awtVCOdhGDQN+CQQmVzIqFKn6GziXQ==", +======= + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.3.tgz", + "integrity": "sha512-nzZ6d6a4flLpm3pZOGpuAUxLlp9heob7QcCkyIqZlCLvciUibgufRfYTwfkWCc4NaGHGSZyodzvfr79H6oUwGQ==", +>>>>>>> 5434e50 (chore: add mutation test) "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/context": "^0.7.0", @@ -2901,9 +2922,15 @@ } }, "node_modules/@remix-run/router": { +<<<<<<< HEAD "version": "1.0.4", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.4.tgz", "integrity": "sha512-gTL8H5USTAKOyVA4xczzDJnC3HMssdFa3tRlwBicXynx9XfiXwneHnYQogwSKpdCkjXISrEKSTtX62rLpNEVQg==", +======= + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.1.tgz", + "integrity": "sha512-XiY0IsyHR+DXYS5vBxpoBe/8veTeoRpMHP+vDosLZxL5bnpetzI0igkxkLZS235ldLzyfkxF+2divEwWHP3vMQ==", +>>>>>>> 5434e50 (chore: add mutation test) "engines": { "node": ">=14" } @@ -2997,9 +3024,9 @@ } }, "node_modules/@sideway/formula": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", - "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", "dev": true }, "node_modules/@sideway/pinpoint": { @@ -3248,9 +3275,15 @@ } }, "node_modules/@testing-library/cypress": { +<<<<<<< HEAD "version": "8.0.7", "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-8.0.7.tgz", "integrity": "sha512-3HTV725rOS+YHve/gD9coZp/UcPK5xhr4H0GMnq/ni6USdtzVtSOG9WBFtd8rYnrXk8rrGD+0toRFYouJNIG0Q==", +======= + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-9.0.0.tgz", + "integrity": "sha512-c1XiCGeHGGTWn0LAU12sFUfoX3qfId5gcSE2yHode+vsyHDWraxDPALjVnHd4/Fa3j4KBcc5k++Ccy6A9qnkMA==", +>>>>>>> 5434e50 (chore: add mutation test) "dev": true, "dependencies": { "@babel/runtime": "^7.14.6", @@ -3261,7 +3294,11 @@ "npm": ">=6" }, "peerDependencies": { +<<<<<<< HEAD "cypress": "^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" +======= + "cypress": "^12.0.0" +>>>>>>> 5434e50 (chore: add mutation test) } }, "node_modules/@testing-library/dom": { @@ -4486,12 +4523,12 @@ } }, "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz", + "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==", "dev": true, "dependencies": { - "follow-redirects": "^1.14.0" + "follow-redirects": "^1.14.7" } }, "node_modules/axobject-query": { @@ -5213,9 +5250,9 @@ } }, "node_modules/cli-table3": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", - "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, "dependencies": { "string-width": "^4.2.0" @@ -5963,9 +6000,15 @@ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" }, "node_modules/cypress": { +<<<<<<< HEAD "version": "11.2.0", "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", +======= + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.3.0.tgz", + "integrity": "sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==", +>>>>>>> 5434e50 (chore: add mutation test) "dev": true, "hasInstallScript": true, "dependencies": { @@ -6016,13 +6059,13 @@ "cypress": "bin/cypress" }, "engines": { - "node": ">=12.0.0" + "node": "^14.0.0 || ^16.0.0 || >=18.0.0" } }, "node_modules/cypress/node_modules/@types/node": { - "version": "14.18.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.29.tgz", - "integrity": "sha512-LhF+9fbIX4iPzhsRLpK5H7iPdvW8L4IwGciXQIOEcuF62+9nw/VQVsOViAOOGxY3OlOKGLFv0sWwJXdwQeTn6A==", + "version": "14.18.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.35.tgz", + "integrity": "sha512-2ATO8pfhG1kDvw4Lc4C0GXIMSQFFJBCo/R1fSgTwmUlq5oy95LXyjDQinsRVgQY6gp6ghh3H91wk9ES5/5C+Tw==", "dev": true }, "node_modules/cypress/node_modules/commander": { @@ -6142,9 +6185,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz", - "integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA==", + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==", "dev": true }, "node_modules/debug": { @@ -8302,9 +8345,9 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" }, "node_modules/global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, "dependencies": { "ini": "2.0.0" @@ -10342,9 +10385,9 @@ } }, "node_modules/joi": { - "version": "17.6.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz", - "integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==", + "version": "17.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.7.0.tgz", + "integrity": "sha512-1/ugc8djfn93rTE3WRKdCzGGt/EtiYKxITMO4Wiv6q5JL1gl9ePt4kBsl1S499nbosspfctIQTpYIhSmHA3WAg==", "dev": true, "dependencies": { "@hapi/hoek": "^9.0.0", @@ -13245,11 +13288,19 @@ } }, "node_modules/react-router": { +<<<<<<< HEAD "version": "6.4.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.4.tgz", "integrity": "sha512-SA6tSrUCRfuLWeYsTJDuriRqfFIsrSvuH7SqAJHegx9ZgxadE119rU8oOX/rG5FYEthpdEaEljdjDlnBxvfr+Q==", "dependencies": { "@remix-run/router": "1.0.4" +======= + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.6.1.tgz", + "integrity": "sha512-YkvlYRusnI/IN0kDtosUCgxqHeulN5je+ew8W+iA1VvFhf86kA+JEI/X/8NqYcr11hCDDp906S+SGMpBheNeYQ==", + "dependencies": { + "@remix-run/router": "1.2.1" +>>>>>>> 5434e50 (chore: add mutation test) }, "engines": { "node": ">=14" @@ -13259,12 +13310,21 @@ } }, "node_modules/react-router-dom": { +<<<<<<< HEAD "version": "6.4.4", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.4.tgz", "integrity": "sha512-0Axverhw5d+4SBhLqLpzPhNkmv7gahUwlUVIOrRLGJ4/uwt30JVajVJXqv2Qr/LCwyvHhQc7YyK1Do8a9Jj7qA==", "dependencies": { "@remix-run/router": "1.0.4", "react-router": "6.4.4" +======= + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.6.1.tgz", + "integrity": "sha512-u+8BKUtelStKbZD5UcY0NY90WOzktrkJJhyhNg7L0APn9t1qJNLowzrM9CHdpB6+rcPt6qQrlkIXsTvhuXP68g==", + "dependencies": { + "@remix-run/router": "1.2.1", + "react-router": "6.6.1" +>>>>>>> 5434e50 (chore: add mutation test) }, "engines": { "node": ">=14" @@ -14265,19 +14325,25 @@ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, "node_modules/start-server-and-test": { +<<<<<<< HEAD "version": "1.15.0", "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.0.tgz", "integrity": "sha512-T4Chk9ulFuT5LcKUrtAPjOzMQHCYonvQ8kJTZlXc9gEWLmJk9lhNarkIbR9vpbGZZp6nxTDV7jdL5mpvqP1xMw==", +======= + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.2.tgz", + "integrity": "sha512-t5xJX04Hg7hqxiKHMJBz/n4zIMsE6G7hpAcerFAH+4Vh9le/LeyFcJERJM7WLiPygWF9TOg33oroJF1XOzJtYQ==", +>>>>>>> 5434e50 (chore: add mutation test) "dev": true, "dependencies": { "arg": "^5.0.2", "bluebird": "3.7.2", "check-more-types": "2.24.0", - "debug": "4.3.2", + "debug": "4.3.4", "execa": "5.1.1", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", - "wait-on": "6.0.0" + "wait-on": "6.0.1" }, "bin": { "server-test": "src/bin/start.js", @@ -14288,23 +14354,6 @@ "node": ">=6" } }, - "node_modules/start-server-and-test/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -15380,16 +15429,16 @@ } }, "node_modules/wait-on": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz", - "integrity": "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.1.tgz", + "integrity": "sha512-zht+KASY3usTY5u2LgaNqn/Cd8MukxLGjdcZxT2ns5QzDmTFc4XoWBgC+C/na+sMRZTuVygQoMYwdcVjHnYIVw==", "dev": true, "dependencies": { - "axios": "^0.21.1", - "joi": "^17.4.0", + "axios": "^0.25.0", + "joi": "^17.6.0", "lodash": "^4.17.21", "minimist": "^1.2.5", - "rxjs": "^7.1.0" + "rxjs": "^7.5.4" }, "bin": { "wait-on": "bin/wait-on" @@ -16287,9 +16336,15 @@ } }, "@apollo/client": { +<<<<<<< HEAD "version": "3.7.2", "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.2.tgz", "integrity": "sha512-ohAIpXl3mTa1Fd3GT/K37VwQJfTIuuJRp4aOlJ4q/hlx0Wxh+RqDrbn0awtVCOdhGDQN+CQQmVzIqFKn6GziXQ==", +======= + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.3.tgz", + "integrity": "sha512-nzZ6d6a4flLpm3pZOGpuAUxLlp9heob7QcCkyIqZlCLvciUibgufRfYTwfkWCc4NaGHGSZyodzvfr79H6oUwGQ==", +>>>>>>> 5434e50 (chore: add mutation test) "requires": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/context": "^0.7.0", @@ -18230,9 +18285,15 @@ } }, "@remix-run/router": { +<<<<<<< HEAD "version": "1.0.4", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.4.tgz", "integrity": "sha512-gTL8H5USTAKOyVA4xczzDJnC3HMssdFa3tRlwBicXynx9XfiXwneHnYQogwSKpdCkjXISrEKSTtX62rLpNEVQg==" +======= + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.1.tgz", + "integrity": "sha512-XiY0IsyHR+DXYS5vBxpoBe/8veTeoRpMHP+vDosLZxL5bnpetzI0igkxkLZS235ldLzyfkxF+2divEwWHP3vMQ==" +>>>>>>> 5434e50 (chore: add mutation test) }, "@rollup/plugin-babel": { "version": "5.3.1", @@ -18297,9 +18358,9 @@ } }, "@sideway/formula": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", - "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", "dev": true }, "@sideway/pinpoint": { @@ -18450,9 +18511,15 @@ } }, "@testing-library/cypress": { +<<<<<<< HEAD "version": "8.0.7", "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-8.0.7.tgz", "integrity": "sha512-3HTV725rOS+YHve/gD9coZp/UcPK5xhr4H0GMnq/ni6USdtzVtSOG9WBFtd8rYnrXk8rrGD+0toRFYouJNIG0Q==", +======= + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-9.0.0.tgz", + "integrity": "sha512-c1XiCGeHGGTWn0LAU12sFUfoX3qfId5gcSE2yHode+vsyHDWraxDPALjVnHd4/Fa3j4KBcc5k++Ccy6A9qnkMA==", +>>>>>>> 5434e50 (chore: add mutation test) "dev": true, "requires": { "@babel/runtime": "^7.14.6", @@ -19403,12 +19470,12 @@ "integrity": "sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w==" }, "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz", + "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==", "dev": true, "requires": { - "follow-redirects": "^1.14.0" + "follow-redirects": "^1.14.7" } }, "axobject-query": { @@ -19938,9 +20005,9 @@ } }, "cli-table3": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", - "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, "requires": { "@colors/colors": "1.5.0", @@ -20468,9 +20535,15 @@ } }, "cypress": { +<<<<<<< HEAD "version": "11.2.0", "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", +======= + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.3.0.tgz", + "integrity": "sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==", +>>>>>>> 5434e50 (chore: add mutation test) "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -20518,9 +20591,9 @@ }, "dependencies": { "@types/node": { - "version": "14.18.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.29.tgz", - "integrity": "sha512-LhF+9fbIX4iPzhsRLpK5H7iPdvW8L4IwGciXQIOEcuF62+9nw/VQVsOViAOOGxY3OlOKGLFv0sWwJXdwQeTn6A==", + "version": "14.18.35", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.35.tgz", + "integrity": "sha512-2ATO8pfhG1kDvw4Lc4C0GXIMSQFFJBCo/R1fSgTwmUlq5oy95LXyjDQinsRVgQY6gp6ghh3H91wk9ES5/5C+Tw==", "dev": true }, "commander": { @@ -20609,9 +20682,9 @@ } }, "dayjs": { - "version": "1.11.5", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz", - "integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA==", + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==", "dev": true }, "debug": { @@ -22207,9 +22280,9 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" }, "global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, "requires": { "ini": "2.0.0" @@ -23691,9 +23764,9 @@ } }, "joi": { - "version": "17.6.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz", - "integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==", + "version": "17.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.7.0.tgz", + "integrity": "sha512-1/ugc8djfn93rTE3WRKdCzGGt/EtiYKxITMO4Wiv6q5JL1gl9ePt4kBsl1S499nbosspfctIQTpYIhSmHA3WAg==", "dev": true, "requires": { "@hapi/hoek": "^9.0.0", @@ -25633,6 +25706,7 @@ "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" }, "react-router": { +<<<<<<< HEAD "version": "6.4.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.4.tgz", "integrity": "sha512-SA6tSrUCRfuLWeYsTJDuriRqfFIsrSvuH7SqAJHegx9ZgxadE119rU8oOX/rG5FYEthpdEaEljdjDlnBxvfr+Q==", @@ -25647,6 +25721,22 @@ "requires": { "@remix-run/router": "1.0.4", "react-router": "6.4.4" +======= + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.6.1.tgz", + "integrity": "sha512-YkvlYRusnI/IN0kDtosUCgxqHeulN5je+ew8W+iA1VvFhf86kA+JEI/X/8NqYcr11hCDDp906S+SGMpBheNeYQ==", + "requires": { + "@remix-run/router": "1.2.1" + } + }, + "react-router-dom": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.6.1.tgz", + "integrity": "sha512-u+8BKUtelStKbZD5UcY0NY90WOzktrkJJhyhNg7L0APn9t1qJNLowzrM9CHdpB6+rcPt6qQrlkIXsTvhuXP68g==", + "requires": { + "@remix-run/router": "1.2.1", + "react-router": "6.6.1" +>>>>>>> 5434e50 (chore: add mutation test) } }, "react-scripts": { @@ -26396,30 +26486,25 @@ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, "start-server-and-test": { +<<<<<<< HEAD "version": "1.15.0", "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.0.tgz", "integrity": "sha512-T4Chk9ulFuT5LcKUrtAPjOzMQHCYonvQ8kJTZlXc9gEWLmJk9lhNarkIbR9vpbGZZp6nxTDV7jdL5mpvqP1xMw==", +======= + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.2.tgz", + "integrity": "sha512-t5xJX04Hg7hqxiKHMJBz/n4zIMsE6G7hpAcerFAH+4Vh9le/LeyFcJERJM7WLiPygWF9TOg33oroJF1XOzJtYQ==", +>>>>>>> 5434e50 (chore: add mutation test) "dev": true, "requires": { "arg": "^5.0.2", "bluebird": "3.7.2", "check-more-types": "2.24.0", - "debug": "4.3.2", + "debug": "4.3.4", "execa": "5.1.1", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", - "wait-on": "6.0.0" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } + "wait-on": "6.0.1" } }, "statuses": { @@ -27212,16 +27297,16 @@ } }, "wait-on": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz", - "integrity": "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.1.tgz", + "integrity": "sha512-zht+KASY3usTY5u2LgaNqn/Cd8MukxLGjdcZxT2ns5QzDmTFc4XoWBgC+C/na+sMRZTuVygQoMYwdcVjHnYIVw==", "dev": true, "requires": { - "axios": "^0.21.1", - "joi": "^17.4.0", + "axios": "^0.25.0", + "joi": "^17.6.0", "lodash": "^4.17.21", "minimist": "^1.2.5", - "rxjs": "^7.1.0" + "rxjs": "^7.5.4" } }, "walker": { diff --git a/CRA-demo/package.json b/CRA-demo/package.json index 343f510..87e633b 100644 --- a/CRA-demo/package.json +++ b/CRA-demo/package.json @@ -3,19 +3,19 @@ "version": "0.1.0", "private": false, "dependencies": { - "@apollo/client": "3.7.2", + "@apollo/client": "3.7.3", "graphql": "16.6.0", "react": "18.2.0", "react-dom": "18.2.0", - "react-router-dom": "6.4.4", + "react-router-dom": "6.6.1", "react-scripts": "5.0.1", "web-vitals": "3.1.0" }, "devDependencies": { - "@testing-library/cypress": "8.0.7", - "cypress": "11.2.0", + "@testing-library/cypress": "9.0.0", + "cypress": "12.3.0", "eslint-plugin-cypress": "2.12.1", - "start-server-and-test": "1.15.0" + "start-server-and-test": "1.15.2" }, "scripts": { "cy:run": "cypress run", diff --git a/CRA-demo/src/index.js b/CRA-demo/src/index.js index 0a36863..5d2948f 100644 --- a/CRA-demo/src/index.js +++ b/CRA-demo/src/index.js @@ -20,9 +20,7 @@ import ErrorInDeferredFragment from "./pages/errorInDeferredFragment"; import ErrorNonNullableInDeferredFragment from "./pages/errorNonNullableInDeferredFragment"; import ErrorNonNullableOutsideDeferredFragment from "./pages/errorNonNullableOutsideDeferredFragment"; import ErrorTopLevelQueryField from "./pages/errorTopLevelQueryField"; - -// mutation testing -import PurchasePage from "./pages/purchase"; +import DeferredMutation from "./pages/deferredMutation"; const root = ReactDOM.createRoot(document.getElementById("root")); @@ -78,10 +76,7 @@ root.render( path="/error-top-level-query-field" element={} /> - } - /> + } /> diff --git a/CRA-demo/src/pages/deferredMutation.js b/CRA-demo/src/pages/deferredMutation.js new file mode 100644 index 0000000..81eebc1 --- /dev/null +++ b/CRA-demo/src/pages/deferredMutation.js @@ -0,0 +1,53 @@ +import { gql } from "@apollo/client"; +import { useMutation } from "@apollo/client"; + +const USER_QUERY = gql` + mutation ($userId: ID!, $paymentInformation: PaymentInformationInput!) { + makePayment(userId: $userId, paymentInformation: $paymentInformation) { + id + ... @defer { + paymentStatus { + __typename + id + ... on PaymentSuccess { + billedAmount + } + ... on PaymentFailed { + reason + } + } + } + } + } +`; + +const variables = { + userId: "1", + paymentInformation: { + fakeInfo: "demo", + }, +}; + +const MakePayment = () => { + const [makePayment, { data, loading, error }] = useMutation(USER_QUERY); + + if (loading) { + return

Loading...

; + } else if (error) { + return
error.message
; + } + return ( +
+ {!data && !loading && ( + <> + + + )} + {data && <>{JSON.stringify(data)}} +
+ ); +}; + +export default MakePayment; diff --git a/CRA-demo/src/pages/purchase.js b/CRA-demo/src/pages/purchase.js deleted file mode 100644 index b6e8d7c..0000000 --- a/CRA-demo/src/pages/purchase.js +++ /dev/null @@ -1,78 +0,0 @@ -import { gql } from "@apollo/client"; -import { useMutation } from "@apollo/client"; - -const Loading = () => { - return ( -
- - Loading... -
- ); -}; - -const USER_QUERY = gql` - mutation ($userId: ID!, $paymentInformation: PaymentInformationInput!) { - makePayment(userId: $userId, paymentInformation: $paymentInformation) { - id - ... @defer { - paymentStatus { - __typename - id - ... on PaymentSuccess { - billedAmount - } - ... on PaymentFailed { - reason - } - } - } - } - } -`; - -const variables = { - userId: "1", - paymentInformation: { - fakeInfo: "demo", - }, -}; - -const MakePayment = () => { - const [makePayment, { data, loading, error }] = useMutation(USER_QUERY); - console.log(data, loading, error); - - if (loading) { - return ; - } else if (error) { - return
error.message
; - } - return ( -
- {!data && !loading && ( - <> - - - )} - {data && <>{JSON.stringify(data)}} -
- ); -}; - -export default MakePayment \ No newline at end of file diff --git a/scripts/docker-compose.router.yml b/scripts/docker-compose.router.yml index 3578ade..517a130 100644 --- a/scripts/docker-compose.router.yml +++ b/scripts/docker-compose.router.yml @@ -2,7 +2,7 @@ version: "3" services: apollo-router: container_name: apollo-router - image: ghcr.io/apollographql/router:v1.5.0 + image: ghcr.io/apollographql/router:v1.7.0 volumes: - ./supergraph.graphql:/dist/schema/supergraph.graphql - ./router.yaml:/dist/config/router.yaml From 827531fbbb8fc471fd559ca47209d7b5c9d3a979 Mon Sep 17 00:00:00 2001 From: alessia Date: Wed, 4 Jan 2023 15:34:59 -0500 Subject: [PATCH 3/3] fix: commit lockfile fixes --- CRA-demo/package-lock.json | 113 ------------------------------------- 1 file changed, 113 deletions(-) diff --git a/CRA-demo/package-lock.json b/CRA-demo/package-lock.json index fed21a8..d50d965 100644 --- a/CRA-demo/package-lock.json +++ b/CRA-demo/package-lock.json @@ -8,34 +8,19 @@ "name": "router-defer-e2e-tests", "version": "0.1.0", "dependencies": { -<<<<<<< HEAD - "@apollo/client": "3.7.2", - "graphql": "16.6.0", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-router-dom": "6.4.4", -======= "@apollo/client": "3.7.3", "graphql": "16.6.0", "react": "18.2.0", "react-dom": "18.2.0", "react-router-dom": "6.6.1", ->>>>>>> 5434e50 (chore: add mutation test) "react-scripts": "5.0.1", "web-vitals": "3.1.0" }, "devDependencies": { -<<<<<<< HEAD - "@testing-library/cypress": "8.0.7", - "cypress": "11.2.0", - "eslint-plugin-cypress": "2.12.1", - "start-server-and-test": "1.15.0" -======= "@testing-library/cypress": "9.0.0", "cypress": "12.3.0", "eslint-plugin-cypress": "2.12.1", "start-server-and-test": "1.15.2" ->>>>>>> 5434e50 (chore: add mutation test) } }, "node_modules/@ampproject/remapping": { @@ -51,15 +36,9 @@ } }, "node_modules/@apollo/client": { -<<<<<<< HEAD - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.2.tgz", - "integrity": "sha512-ohAIpXl3mTa1Fd3GT/K37VwQJfTIuuJRp4aOlJ4q/hlx0Wxh+RqDrbn0awtVCOdhGDQN+CQQmVzIqFKn6GziXQ==", -======= "version": "3.7.3", "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.3.tgz", "integrity": "sha512-nzZ6d6a4flLpm3pZOGpuAUxLlp9heob7QcCkyIqZlCLvciUibgufRfYTwfkWCc4NaGHGSZyodzvfr79H6oUwGQ==", ->>>>>>> 5434e50 (chore: add mutation test) "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/context": "^0.7.0", @@ -2922,15 +2901,9 @@ } }, "node_modules/@remix-run/router": { -<<<<<<< HEAD - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.4.tgz", - "integrity": "sha512-gTL8H5USTAKOyVA4xczzDJnC3HMssdFa3tRlwBicXynx9XfiXwneHnYQogwSKpdCkjXISrEKSTtX62rLpNEVQg==", -======= "version": "1.2.1", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.1.tgz", "integrity": "sha512-XiY0IsyHR+DXYS5vBxpoBe/8veTeoRpMHP+vDosLZxL5bnpetzI0igkxkLZS235ldLzyfkxF+2divEwWHP3vMQ==", ->>>>>>> 5434e50 (chore: add mutation test) "engines": { "node": ">=14" } @@ -3275,15 +3248,9 @@ } }, "node_modules/@testing-library/cypress": { -<<<<<<< HEAD - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-8.0.7.tgz", - "integrity": "sha512-3HTV725rOS+YHve/gD9coZp/UcPK5xhr4H0GMnq/ni6USdtzVtSOG9WBFtd8rYnrXk8rrGD+0toRFYouJNIG0Q==", -======= "version": "9.0.0", "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-9.0.0.tgz", "integrity": "sha512-c1XiCGeHGGTWn0LAU12sFUfoX3qfId5gcSE2yHode+vsyHDWraxDPALjVnHd4/Fa3j4KBcc5k++Ccy6A9qnkMA==", ->>>>>>> 5434e50 (chore: add mutation test) "dev": true, "dependencies": { "@babel/runtime": "^7.14.6", @@ -3294,11 +3261,7 @@ "npm": ">=6" }, "peerDependencies": { -<<<<<<< HEAD - "cypress": "^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" -======= "cypress": "^12.0.0" ->>>>>>> 5434e50 (chore: add mutation test) } }, "node_modules/@testing-library/dom": { @@ -6000,15 +5963,9 @@ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" }, "node_modules/cypress": { -<<<<<<< HEAD - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", - "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", -======= "version": "12.3.0", "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.3.0.tgz", "integrity": "sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==", ->>>>>>> 5434e50 (chore: add mutation test) "dev": true, "hasInstallScript": true, "dependencies": { @@ -13288,19 +13245,11 @@ } }, "node_modules/react-router": { -<<<<<<< HEAD - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.4.tgz", - "integrity": "sha512-SA6tSrUCRfuLWeYsTJDuriRqfFIsrSvuH7SqAJHegx9ZgxadE119rU8oOX/rG5FYEthpdEaEljdjDlnBxvfr+Q==", - "dependencies": { - "@remix-run/router": "1.0.4" -======= "version": "6.6.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.6.1.tgz", "integrity": "sha512-YkvlYRusnI/IN0kDtosUCgxqHeulN5je+ew8W+iA1VvFhf86kA+JEI/X/8NqYcr11hCDDp906S+SGMpBheNeYQ==", "dependencies": { "@remix-run/router": "1.2.1" ->>>>>>> 5434e50 (chore: add mutation test) }, "engines": { "node": ">=14" @@ -13310,21 +13259,12 @@ } }, "node_modules/react-router-dom": { -<<<<<<< HEAD - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.4.tgz", - "integrity": "sha512-0Axverhw5d+4SBhLqLpzPhNkmv7gahUwlUVIOrRLGJ4/uwt30JVajVJXqv2Qr/LCwyvHhQc7YyK1Do8a9Jj7qA==", - "dependencies": { - "@remix-run/router": "1.0.4", - "react-router": "6.4.4" -======= "version": "6.6.1", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.6.1.tgz", "integrity": "sha512-u+8BKUtelStKbZD5UcY0NY90WOzktrkJJhyhNg7L0APn9t1qJNLowzrM9CHdpB6+rcPt6qQrlkIXsTvhuXP68g==", "dependencies": { "@remix-run/router": "1.2.1", "react-router": "6.6.1" ->>>>>>> 5434e50 (chore: add mutation test) }, "engines": { "node": ">=14" @@ -14325,15 +14265,9 @@ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, "node_modules/start-server-and-test": { -<<<<<<< HEAD - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.0.tgz", - "integrity": "sha512-T4Chk9ulFuT5LcKUrtAPjOzMQHCYonvQ8kJTZlXc9gEWLmJk9lhNarkIbR9vpbGZZp6nxTDV7jdL5mpvqP1xMw==", -======= "version": "1.15.2", "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.2.tgz", "integrity": "sha512-t5xJX04Hg7hqxiKHMJBz/n4zIMsE6G7hpAcerFAH+4Vh9le/LeyFcJERJM7WLiPygWF9TOg33oroJF1XOzJtYQ==", ->>>>>>> 5434e50 (chore: add mutation test) "dev": true, "dependencies": { "arg": "^5.0.2", @@ -16336,15 +16270,9 @@ } }, "@apollo/client": { -<<<<<<< HEAD - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.2.tgz", - "integrity": "sha512-ohAIpXl3mTa1Fd3GT/K37VwQJfTIuuJRp4aOlJ4q/hlx0Wxh+RqDrbn0awtVCOdhGDQN+CQQmVzIqFKn6GziXQ==", -======= "version": "3.7.3", "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.3.tgz", "integrity": "sha512-nzZ6d6a4flLpm3pZOGpuAUxLlp9heob7QcCkyIqZlCLvciUibgufRfYTwfkWCc4NaGHGSZyodzvfr79H6oUwGQ==", ->>>>>>> 5434e50 (chore: add mutation test) "requires": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/context": "^0.7.0", @@ -18285,15 +18213,9 @@ } }, "@remix-run/router": { -<<<<<<< HEAD - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.0.4.tgz", - "integrity": "sha512-gTL8H5USTAKOyVA4xczzDJnC3HMssdFa3tRlwBicXynx9XfiXwneHnYQogwSKpdCkjXISrEKSTtX62rLpNEVQg==" -======= "version": "1.2.1", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.1.tgz", "integrity": "sha512-XiY0IsyHR+DXYS5vBxpoBe/8veTeoRpMHP+vDosLZxL5bnpetzI0igkxkLZS235ldLzyfkxF+2divEwWHP3vMQ==" ->>>>>>> 5434e50 (chore: add mutation test) }, "@rollup/plugin-babel": { "version": "5.3.1", @@ -18511,15 +18433,9 @@ } }, "@testing-library/cypress": { -<<<<<<< HEAD - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-8.0.7.tgz", - "integrity": "sha512-3HTV725rOS+YHve/gD9coZp/UcPK5xhr4H0GMnq/ni6USdtzVtSOG9WBFtd8rYnrXk8rrGD+0toRFYouJNIG0Q==", -======= "version": "9.0.0", "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-9.0.0.tgz", "integrity": "sha512-c1XiCGeHGGTWn0LAU12sFUfoX3qfId5gcSE2yHode+vsyHDWraxDPALjVnHd4/Fa3j4KBcc5k++Ccy6A9qnkMA==", ->>>>>>> 5434e50 (chore: add mutation test) "dev": true, "requires": { "@babel/runtime": "^7.14.6", @@ -20535,15 +20451,9 @@ } }, "cypress": { -<<<<<<< HEAD - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", - "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", -======= "version": "12.3.0", "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.3.0.tgz", "integrity": "sha512-ZQNebibi6NBt51TRxRMYKeFvIiQZ01t50HSy7z/JMgRVqBUey3cdjog5MYEbzG6Ktti5ckDt1tfcC47lmFwXkw==", ->>>>>>> 5434e50 (chore: add mutation test) "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -25706,22 +25616,6 @@ "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" }, "react-router": { -<<<<<<< HEAD - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.4.4.tgz", - "integrity": "sha512-SA6tSrUCRfuLWeYsTJDuriRqfFIsrSvuH7SqAJHegx9ZgxadE119rU8oOX/rG5FYEthpdEaEljdjDlnBxvfr+Q==", - "requires": { - "@remix-run/router": "1.0.4" - } - }, - "react-router-dom": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.4.4.tgz", - "integrity": "sha512-0Axverhw5d+4SBhLqLpzPhNkmv7gahUwlUVIOrRLGJ4/uwt30JVajVJXqv2Qr/LCwyvHhQc7YyK1Do8a9Jj7qA==", - "requires": { - "@remix-run/router": "1.0.4", - "react-router": "6.4.4" -======= "version": "6.6.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.6.1.tgz", "integrity": "sha512-YkvlYRusnI/IN0kDtosUCgxqHeulN5je+ew8W+iA1VvFhf86kA+JEI/X/8NqYcr11hCDDp906S+SGMpBheNeYQ==", @@ -25736,7 +25630,6 @@ "requires": { "@remix-run/router": "1.2.1", "react-router": "6.6.1" ->>>>>>> 5434e50 (chore: add mutation test) } }, "react-scripts": { @@ -26486,15 +26379,9 @@ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, "start-server-and-test": { -<<<<<<< HEAD - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.0.tgz", - "integrity": "sha512-T4Chk9ulFuT5LcKUrtAPjOzMQHCYonvQ8kJTZlXc9gEWLmJk9lhNarkIbR9vpbGZZp6nxTDV7jdL5mpvqP1xMw==", -======= "version": "1.15.2", "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-1.15.2.tgz", "integrity": "sha512-t5xJX04Hg7hqxiKHMJBz/n4zIMsE6G7hpAcerFAH+4Vh9le/LeyFcJERJM7WLiPygWF9TOg33oroJF1XOzJtYQ==", ->>>>>>> 5434e50 (chore: add mutation test) "dev": true, "requires": { "arg": "^5.0.2",