From 9fe024ecffcfdcee329f473a0bc979613547cd3c Mon Sep 17 00:00:00 2001 From: Antoine Cormouls Date: Sun, 27 Aug 2023 12:57:36 +0200 Subject: [PATCH 1/4] refactor: update graphql-yoga to 4.X.X --- package-lock.json | 938 +++++++++++++++--------------- package.json | 11 +- spec/ParseGraphQLServer.spec.js | 6 +- src/GraphQL/ParseGraphQLServer.js | 18 +- src/GraphQL/parseGraphQLUtils.js | 4 +- 5 files changed, 486 insertions(+), 491 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5be0e7194d..e0376453bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,9 @@ "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", - "@graphql-yoga/node": "2.6.0", "@parse/fs-files-adapter": "1.2.2", "@parse/push-adapter": "4.2.0", + "@whatwg-node/fetch": "^0.9.9", "bcryptjs": "2.4.3", "body-parser": "1.20.2", "commander": "10.0.1", @@ -29,6 +29,7 @@ "graphql-list-fields": "2.0.2", "graphql-relay": "0.10.0", "graphql-tag": "2.12.6", + "graphql-yoga": "4.0.4", "intersect": "1.0.1", "ip-range-check": "0.2.0", "jsonwebtoken": "9.0.0", @@ -1860,82 +1861,6 @@ "kuler": "^2.0.0" } }, - "node_modules/@envelop/core": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@envelop/core/-/core-2.6.0.tgz", - "integrity": "sha512-yTptKinJN//i6m1kXUbnLBl/FobzddI4ehURAMS08eRUOQwAuXqJU9r8VdTav8nIZLb4t6cuDWFb3n331LiwLw==", - "dependencies": { - "@envelop/types": "2.4.0", - "tslib": "2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@envelop/core/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/@envelop/parser-cache": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@envelop/parser-cache/-/parser-cache-4.7.0.tgz", - "integrity": "sha512-63NfXDcW/vGn4U6NFxaZ0JbYWAcJb9A6jhTvghsSz1ZS+Dny/ci8bVSgVmM1q+N56hPyGsVPuyI+rIc71mPU5g==", - "dependencies": { - "lru-cache": "^6.0.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "@envelop/core": "^2.6.0", - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@envelop/parser-cache/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@envelop/types": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@envelop/types/-/types-2.4.0.tgz", - "integrity": "sha512-pjxS98cDQBS84X29VcwzH3aJ/KiLCGwyMxuj7/5FkdiaCXAD1JEvKEj9LARWlFYj1bY43uII4+UptFebrhiIaw==", - "dependencies": { - "tslib": "^2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@envelop/validation-cache": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@envelop/validation-cache/-/validation-cache-4.7.0.tgz", - "integrity": "sha512-PzL+GfWJRT+JjsJqZAIxHKEkvkM3hxkeytS5O0QLXT8kURNBV28r+Kdnn2RCF5+6ILhyGpiDb60vaquBi7g4lw==", - "dependencies": { - "lru-cache": "^6.0.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "@envelop/core": "^2.6.0", - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@envelop/validation-cache/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@eslint/eslintrc": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", @@ -1983,6 +1908,48 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@graphql-tools/executor": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/executor/-/executor-1.2.0.tgz", + "integrity": "sha512-SKlIcMA71Dha5JnEWlw4XxcaJ+YupuXg0QCZgl2TOLFz4SkGCwU/geAsJvUJFwK2RbVLpQv/UMq67lOaBuwDtg==", + "dependencies": { + "@graphql-tools/utils": "^10.0.0", + "@graphql-typed-document-node/core": "3.2.0", + "@repeaterjs/repeater": "^3.0.4", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/executor/node_modules/@graphql-tools/utils": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.5.tgz", + "integrity": "sha512-ZTioQqg9z9eCG3j+KDy54k1gp6wRIsLqkx5yi163KVvXVkfjsrdErCyZjrEug21QnKE9piP4tyxMpMMOT1RuRw==", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "dset": "^3.1.2", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/executor/node_modules/value-or-promise": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", + "engines": { + "node": ">=12" + } + }, "node_modules/@graphql-tools/merge": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.1.tgz", @@ -2045,93 +2012,34 @@ } }, "node_modules/@graphql-typed-document-node/core": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.1.tgz", - "integrity": "sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==", - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@graphql-yoga/common": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@graphql-yoga/common/-/common-2.6.0.tgz", - "integrity": "sha512-iG33wMQlBujB1+Q2D/CLEVDW3xTeBVhHKsbaUmVSHV4zpmGRRQMg/YROJ2mU1lONOyZDPIC+9j3AR7+x0dSzoA==", - "dependencies": { - "@envelop/core": "^2.0.0", - "@envelop/parser-cache": "^4.0.0", - "@envelop/validation-cache": "^4.0.0", - "@graphql-tools/schema": "^8.3.1", - "@graphql-tools/utils": "^8.6.0", - "@graphql-typed-document-node/core": "^3.1.1", - "@graphql-yoga/subscription": "2.0.0", - "cross-undici-fetch": "^0.4.2", - "dset": "^3.1.1", - "tslib": "^2.3.1" - }, - "peerDependencies": { - "graphql": "^15.2.0 || ^16.0.0" - } - }, - "node_modules/@graphql-yoga/common/node_modules/@graphql-tools/merge": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", - "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", - "dependencies": { - "@graphql-tools/utils": "8.9.0", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-yoga/common/node_modules/@graphql-tools/schema": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", - "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", - "dependencies": { - "@graphql-tools/merge": "8.3.1", - "@graphql-tools/utils": "8.9.0", - "tslib": "^2.4.0", - "value-or-promise": "1.0.11" - }, + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@graphql-yoga/common/node_modules/@graphql-tools/utils": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", - "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", + "node_modules/@graphql-yoga/logger": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@graphql-yoga/logger/-/logger-1.0.0.tgz", + "integrity": "sha512-JYoxwnPggH2BfO+dWlWZkDeFhyFZqaTRGLvFhy+Pjp2UxitEW6nDrw+pEDw/K9tJwMjIFMmTT9VfTqrnESmBHg==", "dependencies": { - "tslib": "^2.4.0" + "tslib": "^2.5.2" }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-yoga/node": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@graphql-yoga/node/-/node-2.6.0.tgz", - "integrity": "sha512-VkHaiIwDYx+WJI/NnT2x+mGknk1YoNTP/auweDvKzPXdsWR5Za8rEYUloKZX4TxHTpyqbBLMtCt+4TDITriVbA==", - "dependencies": { - "@envelop/core": "^2.0.0", - "@graphql-tools/utils": "^8.6.0", - "@graphql-yoga/common": "2.6.0", - "@graphql-yoga/subscription": "2.0.0", - "cross-undici-fetch": "^0.4.2", - "tslib": "^2.3.1" - }, - "peerDependencies": { - "graphql": "^15.2.0 || ^16.0.0" + "engines": { + "node": ">=16.0.0" } }, - "node_modules/@graphql-yoga/subscription": { + "node_modules/@graphql-yoga/typed-event-target": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@graphql-yoga/subscription/-/subscription-2.0.0.tgz", - "integrity": "sha512-HlG+gIddjIP3/BDrMZymdzmzDjNdYuSGMxx6+1JA83gAEVRDR4yOoT4QeNKYqRhLK9xca/Hxp1PfBpquSa244Q==", + "resolved": "https://registry.npmjs.org/@graphql-yoga/typed-event-target/-/typed-event-target-2.0.0.tgz", + "integrity": "sha512-oA/VGxGmaSDym1glOHrltw43qZsFwLLjBwvh57B79UKX/vo3+UQcRgOyE44c5RP7DCYjkrC2tuArZmb6jCzysw==", "dependencies": { "@repeaterjs/repeater": "^3.0.4", - "tslib": "^2.3.1" + "tslib": "^2.5.2" + }, + "engines": { + "node": ">=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { @@ -3438,6 +3346,53 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@whatwg-node/events": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@whatwg-node/events/-/events-0.1.1.tgz", + "integrity": "sha512-AyQEn5hIPV7Ze+xFoXVU3QTHXVbWPrzaOkxtENMPMuNL6VVHrp4hHfDt9nrQpjO7BgvuM95dMtkycX5M/DZR3w==", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@whatwg-node/fetch": { + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/@whatwg-node/fetch/-/fetch-0.9.9.tgz", + "integrity": "sha512-OTVoDm039CNyAWSRc2WBimMl/N9J4Fk2le21Xzcf+3OiWPNNSIbMnpWKBUyraPh2d9SAEgoBdQxTfVNihXgiUw==", + "dependencies": { + "@whatwg-node/node-fetch": "^0.4.8", + "urlpattern-polyfill": "^9.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@whatwg-node/node-fetch": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@whatwg-node/node-fetch/-/node-fetch-0.4.14.tgz", + "integrity": "sha512-ii/eZz2PcjLGj9D6WfsmfzlTzZV1Kz6MxYpq2Vc5P21J8vkKfENWC9B2ISsFCKovxElLukIwPg8HTrHFsLNflg==", + "dependencies": { + "@whatwg-node/events": "^0.1.0", + "busboy": "^1.6.0", + "fast-querystring": "^1.1.1", + "fast-url-parser": "^1.1.3", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@whatwg-node/server": { + "version": "0.9.13", + "resolved": "https://registry.npmjs.org/@whatwg-node/server/-/server-0.9.13.tgz", + "integrity": "sha512-S4wL2RiAelX2gTE+jLRwd2Ep9v3qLai4LhRbw5TCLuquHh7CIqdpNhFDTHdEqE/OIgfy1OKOkRDYIhtCZqgLTQ==", + "dependencies": { + "@whatwg-node/fetch": "^0.9.7", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/@wry/context": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.6.1.tgz", @@ -3474,17 +3429,6 @@ "node": ">=8" } }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/abstract-logging": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", @@ -5444,58 +5388,6 @@ "node": ">= 8" } }, - "node_modules/cross-undici-fetch": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/cross-undici-fetch/-/cross-undici-fetch-0.4.14.tgz", - "integrity": "sha512-CCep44A/baoO8kYJBIR1cRO/tRAk29xzb/tH3O85OtgwZGkL5I0tJZ47ccZdrnAJxrl5tlaYhAOx09fJXMcUqQ==", - "dependencies": { - "abort-controller": "^3.0.0", - "busboy": "^1.6.0", - "form-data-encoder": "^1.7.1", - "formdata-node": "^4.3.1", - "node-fetch": "^2.6.7", - "undici": "5.5.1", - "web-streams-polyfill": "^3.2.0" - } - }, - "node_modules/cross-undici-fetch/node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/cross-undici-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/cross-undici-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/cross-undici-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/crypto-js": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", @@ -7150,14 +7042,6 @@ "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/eventemitter3": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", @@ -7484,6 +7368,11 @@ "node >=0.6.0" ] }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -7527,6 +7416,22 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==", + "dependencies": { + "punycode": "^1.3.2" + } + }, "node_modules/fastq": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", @@ -8050,31 +7955,6 @@ "node": ">= 6" } }, - "node_modules/form-data-encoder": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" - }, - "node_modules/formdata-node": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", - "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", - "dependencies": { - "node-domexception": "1.0.0", - "web-streams-polyfill": "4.0.0-beta.3" - }, - "engines": { - "node": ">= 12.20" - } - }, - "node_modules/formdata-node/node_modules/web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", - "engines": { - "node": ">= 14" - } - }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -8631,6 +8511,131 @@ "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, + "node_modules/graphql-yoga": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/graphql-yoga/-/graphql-yoga-4.0.4.tgz", + "integrity": "sha512-MvCLhFecYNIKuxAZisPjpIL9lxRYbpgPSNKENDO/8CV3oiFlsLJHZb5dp2sVAeLafXHeZ9TgkijLthUBc1+Jag==", + "dependencies": { + "@envelop/core": "^4.0.0", + "@graphql-tools/executor": "^1.0.0", + "@graphql-tools/schema": "^10.0.0", + "@graphql-tools/utils": "^10.0.0", + "@graphql-yoga/logger": "^1.0.0", + "@graphql-yoga/subscription": "^4.0.0", + "@whatwg-node/fetch": "^0.9.7", + "@whatwg-node/server": "^0.9.1", + "dset": "^3.1.1", + "lru-cache": "^10.0.0", + "tslib": "^2.5.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "graphql": "^15.2.0 || ^16.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/@envelop/core": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@envelop/core/-/core-4.0.0.tgz", + "integrity": "sha512-6usEZO86hWT0ZajAbhOX0QXlV++lrlEmu8br6KQVvyXOxttiHADIibgfzb3GtSI7RnnJDnrcRb7Jynv6Lca3iQ==", + "dependencies": { + "@envelop/types": "4.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/@envelop/types": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@envelop/types/-/types-4.0.0.tgz", + "integrity": "sha512-dmBK16VVfKCkqYYemvE+gt1cPBP0d9CbYO4yjNhSSYy9K+w6+Lw48wOLK238mSR339PNAvwj/JW/qzNy2llggA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/@graphql-tools/merge": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-9.0.0.tgz", + "integrity": "sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==", + "dependencies": { + "@graphql-tools/utils": "^10.0.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/@graphql-tools/schema": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-10.0.0.tgz", + "integrity": "sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==", + "dependencies": { + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/utils": "^10.0.0", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/@graphql-tools/utils": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.5.tgz", + "integrity": "sha512-ZTioQqg9z9eCG3j+KDy54k1gp6wRIsLqkx5yi163KVvXVkfjsrdErCyZjrEug21QnKE9piP4tyxMpMMOT1RuRw==", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "dset": "^3.1.2", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/@graphql-yoga/subscription": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@graphql-yoga/subscription/-/subscription-4.0.0.tgz", + "integrity": "sha512-0qsN/BPPZNMoC2CZ8i+P6PgiJyHh1H35aKDt37qARBDaIOKDQuvEOq7+4txUKElcmXi7DYFo109FkhSQoEajrg==", + "dependencies": { + "@graphql-yoga/typed-event-target": "^2.0.0", + "@repeaterjs/repeater": "^3.0.4", + "@whatwg-node/events": "^0.1.0", + "tslib": "^2.5.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/graphql-yoga/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/graphql-yoga/node_modules/value-or-promise": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", + "engines": { + "node": ">=12" + } + }, "node_modules/graphviz": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/graphviz/-/graphviz-0.0.9.tgz", @@ -12399,6 +12404,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true, "funding": [ { "type": "github", @@ -19690,9 +19696,9 @@ } }, "node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -19840,14 +19846,6 @@ "integrity": "sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ==", "dev": true }, - "node_modules/undici": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.5.1.tgz", - "integrity": "sha512-MEvryPLf18HvlCbLSzCW0U00IMftKGI5udnjrQbC5D4P0Hodwffhv+iGfWuJwg16Y/TK11ZFK8i+BPVW2z/eAw==", - "engines": { - "node": ">=12.18" - } - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -20099,6 +20097,11 @@ "node": ">= 4" } }, + "node_modules/urlpattern-polyfill": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz", + "integrity": "sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==" + }, "node_modules/use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -20246,6 +20249,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "dev": true, "engines": { "node": ">= 8" } @@ -21903,68 +21907,6 @@ "kuler": "^2.0.0" } }, - "@envelop/core": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@envelop/core/-/core-2.6.0.tgz", - "integrity": "sha512-yTptKinJN//i6m1kXUbnLBl/FobzddI4ehURAMS08eRUOQwAuXqJU9r8VdTav8nIZLb4t6cuDWFb3n331LiwLw==", - "requires": { - "@envelop/types": "2.4.0", - "tslib": "2.4.0" - }, - "dependencies": { - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - } - } - }, - "@envelop/parser-cache": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@envelop/parser-cache/-/parser-cache-4.7.0.tgz", - "integrity": "sha512-63NfXDcW/vGn4U6NFxaZ0JbYWAcJb9A6jhTvghsSz1ZS+Dny/ci8bVSgVmM1q+N56hPyGsVPuyI+rIc71mPU5g==", - "requires": { - "lru-cache": "^6.0.0", - "tslib": "^2.4.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - } - } - }, - "@envelop/types": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@envelop/types/-/types-2.4.0.tgz", - "integrity": "sha512-pjxS98cDQBS84X29VcwzH3aJ/KiLCGwyMxuj7/5FkdiaCXAD1JEvKEj9LARWlFYj1bY43uII4+UptFebrhiIaw==", - "requires": { - "tslib": "^2.4.0" - } - }, - "@envelop/validation-cache": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@envelop/validation-cache/-/validation-cache-4.7.0.tgz", - "integrity": "sha512-PzL+GfWJRT+JjsJqZAIxHKEkvkM3hxkeytS5O0QLXT8kURNBV28r+Kdnn2RCF5+6ILhyGpiDb60vaquBi7g4lw==", - "requires": { - "lru-cache": "^6.0.0", - "tslib": "^2.4.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - } - } - }, "@eslint/eslintrc": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", @@ -21996,6 +21938,35 @@ } } }, + "@graphql-tools/executor": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/executor/-/executor-1.2.0.tgz", + "integrity": "sha512-SKlIcMA71Dha5JnEWlw4XxcaJ+YupuXg0QCZgl2TOLFz4SkGCwU/geAsJvUJFwK2RbVLpQv/UMq67lOaBuwDtg==", + "requires": { + "@graphql-tools/utils": "^10.0.0", + "@graphql-typed-document-node/core": "3.2.0", + "@repeaterjs/repeater": "^3.0.4", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + }, + "dependencies": { + "@graphql-tools/utils": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.5.tgz", + "integrity": "sha512-ZTioQqg9z9eCG3j+KDy54k1gp6wRIsLqkx5yi163KVvXVkfjsrdErCyZjrEug21QnKE9piP4tyxMpMMOT1RuRw==", + "requires": { + "@graphql-typed-document-node/core": "^3.1.1", + "dset": "^3.1.2", + "tslib": "^2.4.0" + } + }, + "value-or-promise": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==" + } + } + }, "@graphql-tools/merge": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.1.tgz", @@ -22047,78 +22018,26 @@ } }, "@graphql-typed-document-node/core": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.1.tgz", - "integrity": "sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "requires": {} }, - "@graphql-yoga/common": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@graphql-yoga/common/-/common-2.6.0.tgz", - "integrity": "sha512-iG33wMQlBujB1+Q2D/CLEVDW3xTeBVhHKsbaUmVSHV4zpmGRRQMg/YROJ2mU1lONOyZDPIC+9j3AR7+x0dSzoA==", - "requires": { - "@envelop/core": "^2.0.0", - "@envelop/parser-cache": "^4.0.0", - "@envelop/validation-cache": "^4.0.0", - "@graphql-tools/schema": "^8.3.1", - "@graphql-tools/utils": "^8.6.0", - "@graphql-typed-document-node/core": "^3.1.1", - "@graphql-yoga/subscription": "2.0.0", - "cross-undici-fetch": "^0.4.2", - "dset": "^3.1.1", - "tslib": "^2.3.1" - }, - "dependencies": { - "@graphql-tools/merge": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", - "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", - "requires": { - "@graphql-tools/utils": "8.9.0", - "tslib": "^2.4.0" - } - }, - "@graphql-tools/schema": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", - "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", - "requires": { - "@graphql-tools/merge": "8.3.1", - "@graphql-tools/utils": "8.9.0", - "tslib": "^2.4.0", - "value-or-promise": "1.0.11" - } - }, - "@graphql-tools/utils": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", - "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", - "requires": { - "tslib": "^2.4.0" - } - } - } - }, - "@graphql-yoga/node": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@graphql-yoga/node/-/node-2.6.0.tgz", - "integrity": "sha512-VkHaiIwDYx+WJI/NnT2x+mGknk1YoNTP/auweDvKzPXdsWR5Za8rEYUloKZX4TxHTpyqbBLMtCt+4TDITriVbA==", - "requires": { - "@envelop/core": "^2.0.0", - "@graphql-tools/utils": "^8.6.0", - "@graphql-yoga/common": "2.6.0", - "@graphql-yoga/subscription": "2.0.0", - "cross-undici-fetch": "^0.4.2", - "tslib": "^2.3.1" + "@graphql-yoga/logger": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@graphql-yoga/logger/-/logger-1.0.0.tgz", + "integrity": "sha512-JYoxwnPggH2BfO+dWlWZkDeFhyFZqaTRGLvFhy+Pjp2UxitEW6nDrw+pEDw/K9tJwMjIFMmTT9VfTqrnESmBHg==", + "requires": { + "tslib": "^2.5.2" } }, - "@graphql-yoga/subscription": { + "@graphql-yoga/typed-event-target": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@graphql-yoga/subscription/-/subscription-2.0.0.tgz", - "integrity": "sha512-HlG+gIddjIP3/BDrMZymdzmzDjNdYuSGMxx6+1JA83gAEVRDR4yOoT4QeNKYqRhLK9xca/Hxp1PfBpquSa244Q==", + "resolved": "https://registry.npmjs.org/@graphql-yoga/typed-event-target/-/typed-event-target-2.0.0.tgz", + "integrity": "sha512-oA/VGxGmaSDym1glOHrltw43qZsFwLLjBwvh57B79UKX/vo3+UQcRgOyE44c5RP7DCYjkrC2tuArZmb6jCzysw==", "requires": { "@repeaterjs/repeater": "^3.0.4", - "tslib": "^2.3.1" + "tslib": "^2.5.2" } }, "@humanwhocodes/config-array": { @@ -23102,6 +23021,41 @@ "eslint-visitor-keys": "^2.0.0" } }, + "@whatwg-node/events": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@whatwg-node/events/-/events-0.1.1.tgz", + "integrity": "sha512-AyQEn5hIPV7Ze+xFoXVU3QTHXVbWPrzaOkxtENMPMuNL6VVHrp4hHfDt9nrQpjO7BgvuM95dMtkycX5M/DZR3w==" + }, + "@whatwg-node/fetch": { + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/@whatwg-node/fetch/-/fetch-0.9.9.tgz", + "integrity": "sha512-OTVoDm039CNyAWSRc2WBimMl/N9J4Fk2le21Xzcf+3OiWPNNSIbMnpWKBUyraPh2d9SAEgoBdQxTfVNihXgiUw==", + "requires": { + "@whatwg-node/node-fetch": "^0.4.8", + "urlpattern-polyfill": "^9.0.0" + } + }, + "@whatwg-node/node-fetch": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/@whatwg-node/node-fetch/-/node-fetch-0.4.14.tgz", + "integrity": "sha512-ii/eZz2PcjLGj9D6WfsmfzlTzZV1Kz6MxYpq2Vc5P21J8vkKfENWC9B2ISsFCKovxElLukIwPg8HTrHFsLNflg==", + "requires": { + "@whatwg-node/events": "^0.1.0", + "busboy": "^1.6.0", + "fast-querystring": "^1.1.1", + "fast-url-parser": "^1.1.3", + "tslib": "^2.3.1" + } + }, + "@whatwg-node/server": { + "version": "0.9.13", + "resolved": "https://registry.npmjs.org/@whatwg-node/server/-/server-0.9.13.tgz", + "integrity": "sha512-S4wL2RiAelX2gTE+jLRwd2Ep9v3qLai4LhRbw5TCLuquHh7CIqdpNhFDTHdEqE/OIgfy1OKOkRDYIhtCZqgLTQ==", + "requires": { + "@whatwg-node/fetch": "^0.9.7", + "tslib": "^2.3.1" + } + }, "@wry/context": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.6.1.tgz", @@ -23129,14 +23083,6 @@ "tslib": "^2.3.0" } }, - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } - }, "abstract-logging": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", @@ -24670,49 +24616,6 @@ "which": "^2.0.1" } }, - "cross-undici-fetch": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/cross-undici-fetch/-/cross-undici-fetch-0.4.14.tgz", - "integrity": "sha512-CCep44A/baoO8kYJBIR1cRO/tRAk29xzb/tH3O85OtgwZGkL5I0tJZ47ccZdrnAJxrl5tlaYhAOx09fJXMcUqQ==", - "requires": { - "abort-controller": "^3.0.0", - "busboy": "^1.6.0", - "form-data-encoder": "^1.7.1", - "formdata-node": "^4.3.1", - "node-fetch": "^2.6.7", - "undici": "5.5.1", - "web-streams-polyfill": "^3.2.0" - }, - "dependencies": { - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } - } - }, "crypto-js": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", @@ -26016,11 +25919,6 @@ } } }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, "eventemitter3": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", @@ -26293,6 +26191,11 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==" }, + "fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -26332,6 +26235,22 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "requires": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==", + "requires": { + "punycode": "^1.3.2" + } + }, "fastq": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", @@ -26706,27 +26625,6 @@ "mime-types": "^2.1.12" } }, - "form-data-encoder": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" - }, - "formdata-node": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", - "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", - "requires": { - "node-domexception": "1.0.0", - "web-streams-polyfill": "4.0.0-beta.3" - }, - "dependencies": { - "web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==" - } - } - }, "formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -27154,6 +27052,94 @@ "tslib": "^2.1.0" } }, + "graphql-yoga": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/graphql-yoga/-/graphql-yoga-4.0.4.tgz", + "integrity": "sha512-MvCLhFecYNIKuxAZisPjpIL9lxRYbpgPSNKENDO/8CV3oiFlsLJHZb5dp2sVAeLafXHeZ9TgkijLthUBc1+Jag==", + "requires": { + "@envelop/core": "^4.0.0", + "@graphql-tools/executor": "^1.0.0", + "@graphql-tools/schema": "^10.0.0", + "@graphql-tools/utils": "^10.0.0", + "@graphql-yoga/logger": "^1.0.0", + "@graphql-yoga/subscription": "^4.0.0", + "@whatwg-node/fetch": "^0.9.7", + "@whatwg-node/server": "^0.9.1", + "dset": "^3.1.1", + "lru-cache": "^10.0.0", + "tslib": "^2.5.2" + }, + "dependencies": { + "@envelop/core": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@envelop/core/-/core-4.0.0.tgz", + "integrity": "sha512-6usEZO86hWT0ZajAbhOX0QXlV++lrlEmu8br6KQVvyXOxttiHADIibgfzb3GtSI7RnnJDnrcRb7Jynv6Lca3iQ==", + "requires": { + "@envelop/types": "4.0.0", + "tslib": "^2.5.0" + } + }, + "@envelop/types": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@envelop/types/-/types-4.0.0.tgz", + "integrity": "sha512-dmBK16VVfKCkqYYemvE+gt1cPBP0d9CbYO4yjNhSSYy9K+w6+Lw48wOLK238mSR339PNAvwj/JW/qzNy2llggA==", + "requires": { + "tslib": "^2.5.0" + } + }, + "@graphql-tools/merge": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-9.0.0.tgz", + "integrity": "sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==", + "requires": { + "@graphql-tools/utils": "^10.0.0", + "tslib": "^2.4.0" + } + }, + "@graphql-tools/schema": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-10.0.0.tgz", + "integrity": "sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==", + "requires": { + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/utils": "^10.0.0", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + } + }, + "@graphql-tools/utils": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.5.tgz", + "integrity": "sha512-ZTioQqg9z9eCG3j+KDy54k1gp6wRIsLqkx5yi163KVvXVkfjsrdErCyZjrEug21QnKE9piP4tyxMpMMOT1RuRw==", + "requires": { + "@graphql-typed-document-node/core": "^3.1.1", + "dset": "^3.1.2", + "tslib": "^2.4.0" + } + }, + "@graphql-yoga/subscription": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@graphql-yoga/subscription/-/subscription-4.0.0.tgz", + "integrity": "sha512-0qsN/BPPZNMoC2CZ8i+P6PgiJyHh1H35aKDt37qARBDaIOKDQuvEOq7+4txUKElcmXi7DYFo109FkhSQoEajrg==", + "requires": { + "@graphql-yoga/typed-event-target": "^2.0.0", + "@repeaterjs/repeater": "^3.0.4", + "@whatwg-node/events": "^0.1.0", + "tslib": "^2.5.2" + } + }, + "lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==" + }, + "value-or-promise": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==" + } + } + }, "graphviz": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/graphviz/-/graphviz-0.0.9.tgz", @@ -30111,7 +30097,8 @@ "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true }, "node-emoji": { "version": "1.11.0", @@ -35572,9 +35559,9 @@ } }, "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "tsutils": { "version": "3.21.0", @@ -35687,11 +35674,6 @@ "integrity": "sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ==", "dev": true }, - "undici": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.5.1.tgz", - "integrity": "sha512-MEvryPLf18HvlCbLSzCW0U00IMftKGI5udnjrQbC5D4P0Hodwffhv+iGfWuJwg16Y/TK11ZFK8i+BPVW2z/eAw==" - }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -35880,6 +35862,11 @@ "integrity": "sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==", "dev": true }, + "urlpattern-polyfill": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz", + "integrity": "sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==" + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -35995,7 +35982,8 @@ "web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "dev": true }, "webidl-conversions": { "version": "7.0.0", diff --git a/package.json b/package.json index 429451f0a4..a17ec08c35 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,9 @@ "@graphql-tools/merge": "8.4.1", "@graphql-tools/schema": "9.0.4", "@graphql-tools/utils": "8.12.0", - "@graphql-yoga/node": "2.6.0", "@parse/fs-files-adapter": "1.2.2", "@parse/push-adapter": "4.2.0", + "@whatwg-node/fetch": "0.9.9", "bcryptjs": "2.4.3", "body-parser": "1.20.2", "commander": "10.0.1", @@ -38,6 +38,7 @@ "graphql-list-fields": "2.0.2", "graphql-relay": "0.10.0", "graphql-tag": "2.12.6", + "graphql-yoga": "4.0.4", "intersect": "1.0.1", "ip-range-check": "0.2.0", "jsonwebtoken": "9.0.0", @@ -126,11 +127,11 @@ "test:mongodb:5.3.2": "npm run test:mongodb --dbversion=5.3.2", "test:mongodb:6.0.2": "npm run test:mongodb --dbversion=6.0.2", "posttest:mongodb": "mongodb-runner stop", - "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start", - "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine", + "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=6.0.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start", + "testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=6.0.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine", "test": "npm run testonly", - "posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner stop", - "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine", + "posttest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=6.0.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner stop", + "coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=6.0.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine", "start": "node ./bin/parse-server", "prettier": "prettier --write {src,spec}/{**/*,*}.js", "prepare": "npm run build", diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index 87718da13a..de6fec5245 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -126,8 +126,10 @@ describe('ParseGraphQLServer', () => { it("should return schema and context with req's info, config and auth", async () => { const options = await parseGraphQLServer._getGraphQLOptions(); - expect(options.multipart).toEqual({ - fileSize: 20971520, + expect(new options.fetchApi.Body().options).toEqual({ + formDataLimits: { + fileSize: 20971520, + }, }); expect(options.schema).toEqual(parseGraphQLServer.parseGraphQLSchema.graphQLSchema); const contextResponse = options.context({ req }); diff --git a/src/GraphQL/ParseGraphQLServer.js b/src/GraphQL/ParseGraphQLServer.js index 44ea34f47b..3e70ba09f4 100644 --- a/src/GraphQL/ParseGraphQLServer.js +++ b/src/GraphQL/ParseGraphQLServer.js @@ -1,5 +1,6 @@ import corsMiddleware from 'cors'; -import { createServer, renderGraphiQL } from '@graphql-yoga/node'; +import { createYoga, renderGraphiQL } from 'graphql-yoga'; +import { createFetch } from '@whatwg-node/fetch'; import { execute, subscribe } from 'graphql'; import { SubscriptionServer } from 'subscriptions-transport-ws'; import { handleParseErrors, handleParseHeaders, handleParseSession } from '../middlewares'; @@ -39,11 +40,14 @@ class ParseGraphQLServer { auth, }), maskedErrors: false, - multipart: { - fileSize: this._transformMaxUploadSizeToBytes( - this.parseServer.config.maxUploadSize || '20mb' - ), - }, + fetchApi: createFetch({ + useNodeFetch: true, + formDataLimits: { + fileSize: this._transformMaxUploadSizeToBytes( + this.parseServer.config.maxUploadSize || '20mb' + ), + }, + }), }; } catch (e) { this.log.error(e.stack || (typeof e.toString === 'function' && e.toString()) || e); @@ -58,7 +62,7 @@ class ParseGraphQLServer { return this._server; } const options = await this._getGraphQLOptions(); - this._server = createServer(options); + this._server = createYoga(options); return this._server; } diff --git a/src/GraphQL/parseGraphQLUtils.js b/src/GraphQL/parseGraphQLUtils.js index 19b91f681b..2f4998c55c 100644 --- a/src/GraphQL/parseGraphQLUtils.js +++ b/src/GraphQL/parseGraphQLUtils.js @@ -1,5 +1,5 @@ import Parse from 'parse/node'; -import { GraphQLYogaError } from '@graphql-yoga/node'; +import { GraphQLError } from 'graphql'; export function enforceMasterKeyAccess(auth) { if (!auth.isMaster) { @@ -16,7 +16,7 @@ export function toGraphQLError(error) { code = Parse.Error.INTERNAL_SERVER_ERROR; message = 'Internal server error'; } - return new GraphQLYogaError(message, { code }); + return new GraphQLError(message, { extensions: { code } }); } export const extractKeysAndInclude = selectedFields => { From 019faf49d0fed82bf8a20280bc7b118521debc21 Mon Sep 17 00:00:00 2001 From: Antoine Cormouls Date: Sun, 27 Aug 2023 17:02:26 +0200 Subject: [PATCH 2/4] fix: add compat for other fetch polyfill --- src/GraphQL/loaders/filesMutations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GraphQL/loaders/filesMutations.js b/src/GraphQL/loaders/filesMutations.js index 1b6c26ab40..07499b92fd 100644 --- a/src/GraphQL/loaders/filesMutations.js +++ b/src/GraphQL/loaders/filesMutations.js @@ -5,7 +5,7 @@ import * as defaultGraphQLTypes from './defaultGraphQLTypes'; import logger from '../../logger'; const handleUpload = async (upload, config) => { - const data = Buffer.from(await upload.arrayBuffer()); + const data = Buffer.from(upload.arrayBuffer ? await upload.arrayBuffer() : upload.blobParts); const fileName = upload.name; const type = upload.type; From c22d38bdcd06ca43ec45ca3efbaeb1f279ab48f4 Mon Sep 17 00:00:00 2001 From: Antoine Cormouls Date: Mon, 28 Aug 2023 13:13:15 +0200 Subject: [PATCH 3/4] fix: graphql upload for all versions --- package-lock.json | 2 +- spec/ParseGraphQLServer.spec.js | 22 ++++++++++++++-------- src/GraphQL/ParseGraphQLServer.js | 22 +++++++++++++++++----- src/GraphQL/loaders/filesMutations.js | 4 ++-- src/GraphQL/loaders/parseClassMutations.js | 2 ++ src/GraphQL/loaders/usersMutations.js | 2 ++ src/GraphQL/transformers/mutation.js | 13 +++++++++---- 7 files changed, 47 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index e0376453bf..48d1e615b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@graphql-tools/utils": "8.12.0", "@parse/fs-files-adapter": "1.2.2", "@parse/push-adapter": "4.2.0", - "@whatwg-node/fetch": "^0.9.9", + "@whatwg-node/fetch": "0.9.9", "bcryptjs": "2.4.3", "body-parser": "1.20.2", "commander": "10.0.1", diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index de6fec5245..5a6aa1784d 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -6835,7 +6835,7 @@ describe('ParseGraphQLServer', () => { describe('Files Mutations', () => { describe('Create', () => { - it_only_node_version('<17')('should return File object', async () => { + it('should return File object', async () => { const clientMutationId = uuidv4(); parseServer = await global.reconfigureServer({ @@ -9301,7 +9301,7 @@ describe('ParseGraphQLServer', () => { expect(result6[0].node.name).toEqual('imACountry3'); }); - it_only_node_version('<17')('should support files', async () => { + it('should support files', async () => { try { parseServer = await global.reconfigureServer({ publicServerURL: 'http://localhost:13377/parse', @@ -9452,7 +9452,9 @@ describe('ParseGraphQLServer', () => { body: body2, }); expect(res.status).toEqual(200); - const result2 = JSON.parse(await res.text()); + const resText = await res.text(); + const result2 = JSON.parse(resText); + console.log('result2', resText); expect(result2.data.createSomeClass1.someClass.someField.name).toEqual( jasmine.stringMatching(/_myFileName.txt$/) ); @@ -9510,7 +9512,6 @@ describe('ParseGraphQLServer', () => { id: result2.data.createSomeClass1.someClass.id, }, }); - expect(typeof getResult.data.someClass.someField).toEqual('object'); expect(getResult.data.someClass.someField.name).toEqual( result.data.createFile.fileInfo.name @@ -9549,9 +9550,14 @@ describe('ParseGraphQLServer', () => { } }); - it_only_node_version('<17')('should not upload if file is too large', async () => { + it('should not upload if file is too large', async () => { parseGraphQLServer.parseServer.config.maxUploadSize = '1kb'; - + const options = await parseGraphQLServer._getGraphQLOptions(); + expect(new options.fetchApi.Body().options).toEqual({ + formDataLimits: { + fileSize: 1024, + }, + }); const body = new FormData(); body.append( 'operations', @@ -9588,9 +9594,9 @@ describe('ParseGraphQLServer', () => { headers, body, }); - const result = JSON.parse(await res.text()); - expect(res.status).toEqual(500); + console.log(result); + expect(res.status).toEqual(413); expect(result.errors[0].message).toEqual('File size limit exceeded: 1024 bytes'); }); diff --git a/src/GraphQL/ParseGraphQLServer.js b/src/GraphQL/ParseGraphQLServer.js index 3e70ba09f4..c8aecbe5c9 100644 --- a/src/GraphQL/ParseGraphQLServer.js +++ b/src/GraphQL/ParseGraphQLServer.js @@ -32,6 +32,11 @@ class ParseGraphQLServer { async _getGraphQLOptions() { try { + const formDataLimits = { + fileSize: this._transformMaxUploadSizeToBytes( + this.parseServer.config.maxUploadSize || '20mb' + ), + }; return { schema: await this.parseGraphQLSchema.load(), context: ({ req: { info, config, auth } }) => ({ @@ -40,13 +45,19 @@ class ParseGraphQLServer { auth, }), maskedErrors: false, + // Needed to ensure formDataLimits since it seems to not working + // this is a temporary fix until the issue is resolved + // we need to ask graphql-yoga team + plugins: [ + { + onRequestParse: ({ request }) => { + request.options.formDataLimits = formDataLimits; + }, + }, + ], fetchApi: createFetch({ useNodeFetch: true, - formDataLimits: { - fileSize: this._transformMaxUploadSizeToBytes( - this.parseServer.config.maxUploadSize || '20mb' - ), - }, + formDataLimits, }), }; } catch (e) { @@ -89,6 +100,7 @@ class ParseGraphQLServer { app.use(this.config.graphQLPath, handleParseSession); app.use(this.config.graphQLPath, handleParseErrors); app.use(this.config.graphQLPath, async (req, res) => { + // console.log("here", req) const server = await this._getServer(); return server(req, res); }); diff --git a/src/GraphQL/loaders/filesMutations.js b/src/GraphQL/loaders/filesMutations.js index 07499b92fd..976404329e 100644 --- a/src/GraphQL/loaders/filesMutations.js +++ b/src/GraphQL/loaders/filesMutations.js @@ -5,10 +5,10 @@ import * as defaultGraphQLTypes from './defaultGraphQLTypes'; import logger from '../../logger'; const handleUpload = async (upload, config) => { - const data = Buffer.from(upload.arrayBuffer ? await upload.arrayBuffer() : upload.blobParts); + const data = await upload.buffer(); const fileName = upload.name; const type = upload.type; - + console.log('data.length', data.length); if (!data || !data.length) { throw new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'Invalid file upload.'); } diff --git a/src/GraphQL/loaders/parseClassMutations.js b/src/GraphQL/loaders/parseClassMutations.js index 41d7c09dde..eeab9e08bb 100644 --- a/src/GraphQL/loaders/parseClassMutations.js +++ b/src/GraphQL/loaders/parseClassMutations.js @@ -82,6 +82,7 @@ const load = function (parseGraphQLSchema, parseClass, parseClassConfig: ?ParseG const parseFields = await transformTypes('create', fields, { className, parseGraphQLSchema, + originalFields: args.fields || {}, req: { config, auth, info }, }); @@ -190,6 +191,7 @@ const load = function (parseGraphQLSchema, parseClass, parseClassConfig: ?ParseG const parseFields = await transformTypes('update', fields, { className, parseGraphQLSchema, + originalFields: args.fields || {}, req: { config, auth, info }, }); diff --git a/src/GraphQL/loaders/usersMutations.js b/src/GraphQL/loaders/usersMutations.js index 183268a191..7fe7e64b66 100644 --- a/src/GraphQL/loaders/usersMutations.js +++ b/src/GraphQL/loaders/usersMutations.js @@ -38,6 +38,7 @@ const load = parseGraphQLSchema => { const parseFields = await transformTypes('create', fields, { className: '_User', parseGraphQLSchema, + originalFields: args.fields || {}, req: { config, auth, info }, }); @@ -114,6 +115,7 @@ const load = parseGraphQLSchema => { const parseFields = await transformTypes('create', fields, { className: '_User', parseGraphQLSchema, + originalFields: args.fields || {}, req: { config, auth, info }, }); diff --git a/src/GraphQL/transformers/mutation.js b/src/GraphQL/transformers/mutation.js index 5b72d6f05d..d0d73d6d44 100644 --- a/src/GraphQL/transformers/mutation.js +++ b/src/GraphQL/transformers/mutation.js @@ -3,11 +3,12 @@ import { fromGlobalId } from 'graphql-relay'; import { handleUpload } from '../loaders/filesMutations'; import * as defaultGraphQLTypes from '../loaders/defaultGraphQLTypes'; import * as objectsMutations from '../helpers/objectsMutations'; +import deepcopy from 'deepcopy'; const transformTypes = async ( inputType: 'create' | 'update', fields, - { className, parseGraphQLSchema, req } + { className, parseGraphQLSchema, req, originalFields } ) => { const { classGraphQLCreateType, @@ -44,7 +45,9 @@ const transformTypes = async ( fields[field] = transformers.polygon(fields[field]); break; case inputTypeField.type === defaultGraphQLTypes.FILE_INPUT: - fields[field] = await transformers.file(fields[field], req); + // fields are a deepcopy, but we can't deepcopy a stream so + // we use the original fields from the graphql request + fields[field] = await transformers.file(originalFields[field], req); break; case parseClass.fields[field].type === 'Relation': fields[field] = await transformers.relation( @@ -152,9 +155,10 @@ const transformers = { nestedObjectsToAdd = ( await Promise.all( value.createAndAdd.map(async input => { - const parseFields = await transformTypes('create', input, { + const parseFields = await transformTypes('create', deepcopy(input), { className: targetClass, parseGraphQLSchema, + originalFields: input || {}, req: { config, auth, info }, }); return objectsMutations.createObject(targetClass, parseFields, config, auth, info); @@ -213,9 +217,10 @@ const transformers = { let nestedObjectToAdd; if (value.createAndLink) { - const parseFields = await transformTypes('create', value.createAndLink, { + const parseFields = await transformTypes('create', deepcopy(value.createAndLink), { className: targetClass, parseGraphQLSchema, + originalFields: value.createAndLink || {}, req: { config, auth, info }, }); nestedObjectToAdd = await objectsMutations.createObject( From ad477f3f69847011705cae17f1466998e80bc5ef Mon Sep 17 00:00:00 2001 From: Antoine Cormouls Date: Mon, 28 Aug 2023 13:27:07 +0200 Subject: [PATCH 4/4] cleanup --- spec/ParseGraphQLServer.spec.js | 2 -- src/GraphQL/ParseGraphQLServer.js | 1 - src/GraphQL/loaders/filesMutations.js | 1 - 3 files changed, 4 deletions(-) diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index 5a6aa1784d..5f68a5f3a3 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -9454,7 +9454,6 @@ describe('ParseGraphQLServer', () => { expect(res.status).toEqual(200); const resText = await res.text(); const result2 = JSON.parse(resText); - console.log('result2', resText); expect(result2.data.createSomeClass1.someClass.someField.name).toEqual( jasmine.stringMatching(/_myFileName.txt$/) ); @@ -9595,7 +9594,6 @@ describe('ParseGraphQLServer', () => { body, }); const result = JSON.parse(await res.text()); - console.log(result); expect(res.status).toEqual(413); expect(result.errors[0].message).toEqual('File size limit exceeded: 1024 bytes'); }); diff --git a/src/GraphQL/ParseGraphQLServer.js b/src/GraphQL/ParseGraphQLServer.js index c8aecbe5c9..276cf09ab8 100644 --- a/src/GraphQL/ParseGraphQLServer.js +++ b/src/GraphQL/ParseGraphQLServer.js @@ -100,7 +100,6 @@ class ParseGraphQLServer { app.use(this.config.graphQLPath, handleParseSession); app.use(this.config.graphQLPath, handleParseErrors); app.use(this.config.graphQLPath, async (req, res) => { - // console.log("here", req) const server = await this._getServer(); return server(req, res); }); diff --git a/src/GraphQL/loaders/filesMutations.js b/src/GraphQL/loaders/filesMutations.js index 976404329e..d1f5c0f010 100644 --- a/src/GraphQL/loaders/filesMutations.js +++ b/src/GraphQL/loaders/filesMutations.js @@ -8,7 +8,6 @@ const handleUpload = async (upload, config) => { const data = await upload.buffer(); const fileName = upload.name; const type = upload.type; - console.log('data.length', data.length); if (!data || !data.length) { throw new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'Invalid file upload.'); }