Просмотр исходного кода

chore: Fix & refactor graphiql plugin tests, update deps

Michael Bromley 8 месяцев назад
Родитель
Сommit
a27f6d6454

+ 4 - 417
package-lock.json

@@ -4146,18 +4146,6 @@
         "sisteransi": "^1.0.5"
       }
     },
-    "node_modules/@clack/prompts/node_modules/is-unicode-supported": {
-      "version": "1.3.0",
-      "extraneous": true,
-      "inBundle": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
     "node_modules/@clr/angular": {
       "version": "17.9.0",
       "license": "MIT",
@@ -40882,8 +40870,8 @@
         "@types/express": "^5.0.0",
         "@types/react": "^19.0.0",
         "@types/react-dom": "^19.0.0",
-        "@vendure/common": "3.2.3",
-        "@vendure/core": "3.2.3",
+        "@vendure/common": "3.2.4",
+        "@vendure/core": "3.2.4",
         "@vitejs/plugin-react": "^4.3.4",
         "graphiql": "^3.8.3",
         "react": "^19.0.0",
@@ -40896,232 +40884,6 @@
         "url": "https://github.com/sponsors/michaelbromley"
       }
     },
-    "packages/graphiql-plugin/node_modules/@apollo/server": {
-      "version": "4.11.3",
-      "resolved": "https://registry.npmjs.org/@apollo/server/-/server-4.11.3.tgz",
-      "integrity": "sha512-mW8idE2q0/BN14mimfJU5DAnoPHZRrAWgwsVLBEdACds+mxapIYxIbI6AH4AsOpxfrpvHts3PCYDbopy1XPW1g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@apollo/cache-control-types": "^1.0.3",
-        "@apollo/server-gateway-interface": "^1.1.1",
-        "@apollo/usage-reporting-protobuf": "^4.1.1",
-        "@apollo/utils.createhash": "^2.0.2",
-        "@apollo/utils.fetcher": "^2.0.0",
-        "@apollo/utils.isnodelike": "^2.0.0",
-        "@apollo/utils.keyvaluecache": "^2.1.0",
-        "@apollo/utils.logger": "^2.0.0",
-        "@apollo/utils.usagereporting": "^2.1.0",
-        "@apollo/utils.withrequired": "^2.0.0",
-        "@graphql-tools/schema": "^9.0.0",
-        "@types/express": "^4.17.13",
-        "@types/express-serve-static-core": "^4.17.30",
-        "@types/node-fetch": "^2.6.1",
-        "async-retry": "^1.2.1",
-        "cors": "^2.8.5",
-        "express": "^4.21.1",
-        "loglevel": "^1.6.8",
-        "lru-cache": "^7.10.1",
-        "negotiator": "^0.6.3",
-        "node-abort-controller": "^3.1.1",
-        "node-fetch": "^2.6.7",
-        "uuid": "^9.0.0",
-        "whatwg-mimetype": "^3.0.0"
-      },
-      "engines": {
-        "node": ">=14.16.0"
-      },
-      "peerDependencies": {
-        "graphql": "^16.6.0"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@apollo/server/node_modules/@types/express": {
-      "version": "4.17.21",
-      "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz",
-      "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@types/body-parser": "*",
-        "@types/express-serve-static-core": "^4.17.33",
-        "@types/qs": "*",
-        "@types/serve-static": "*"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@apollo/server/node_modules/express": {
-      "version": "4.21.2",
-      "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
-      "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "accepts": "~1.3.8",
-        "array-flatten": "1.1.1",
-        "body-parser": "1.20.3",
-        "content-disposition": "0.5.4",
-        "content-type": "~1.0.4",
-        "cookie": "0.7.1",
-        "cookie-signature": "1.0.6",
-        "debug": "2.6.9",
-        "depd": "2.0.0",
-        "encodeurl": "~2.0.0",
-        "escape-html": "~1.0.3",
-        "etag": "~1.8.1",
-        "finalhandler": "1.3.1",
-        "fresh": "0.5.2",
-        "http-errors": "2.0.0",
-        "merge-descriptors": "1.0.3",
-        "methods": "~1.1.2",
-        "on-finished": "2.4.1",
-        "parseurl": "~1.3.3",
-        "path-to-regexp": "0.1.12",
-        "proxy-addr": "~2.0.7",
-        "qs": "6.13.0",
-        "range-parser": "~1.2.1",
-        "safe-buffer": "5.2.1",
-        "send": "0.19.0",
-        "serve-static": "1.16.2",
-        "setprototypeof": "1.2.0",
-        "statuses": "2.0.1",
-        "type-is": "~1.6.18",
-        "utils-merge": "1.0.1",
-        "vary": "~1.1.2"
-      },
-      "engines": {
-        "node": ">= 0.10.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/express"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@apollo/server/node_modules/lru-cache": {
-      "version": "7.18.3",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
-      "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
-      "dev": true,
-      "license": "ISC",
-      "engines": {
-        "node": ">=12"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@graphql-tools/merge": {
-      "version": "8.4.2",
-      "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz",
-      "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@graphql-tools/utils": "^9.2.1",
-        "tslib": "^2.4.0"
-      },
-      "peerDependencies": {
-        "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@graphql-tools/schema": {
-      "version": "9.0.19",
-      "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz",
-      "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@graphql-tools/merge": "^8.4.1",
-        "@graphql-tools/utils": "^9.2.1",
-        "tslib": "^2.4.0",
-        "value-or-promise": "^1.0.12"
-      },
-      "peerDependencies": {
-        "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@graphql-tools/utils": {
-      "version": "9.2.1",
-      "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz",
-      "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "@graphql-typed-document-node/core": "^3.1.1",
-        "tslib": "^2.4.0"
-      },
-      "peerDependencies": {
-        "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@vendure/common": {
-      "version": "3.2.3",
-      "resolved": "https://registry.npmjs.org/@vendure/common/-/common-3.2.3.tgz",
-      "integrity": "sha512-pXnCfsJtA3kIK0VtOTKQLfjfznNwpkSTnssEuLsyY4KJNrNKAo6WOLNE+c2oaRPLI37iM874z2G4I9XDkVWzxQ==",
-      "dev": true,
-      "license": "GPL-3.0-or-later",
-      "funding": {
-        "url": "https://github.com/sponsors/michaelbromley"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/@vendure/core": {
-      "version": "3.2.3",
-      "resolved": "https://registry.npmjs.org/@vendure/core/-/core-3.2.3.tgz",
-      "integrity": "sha512-wpZjJIWJDJa4AYSRyIVtk6ipDudj7u0AvdOqxV7c7iAVSvxXxAJ3vJvwKvvRRl05k0A0DdNhpl6GyJ52hNHHEw==",
-      "dev": true,
-      "license": "GPL-3.0-or-later",
-      "dependencies": {
-        "@apollo/server": "4.11.3",
-        "@graphql-tools/stitch": "^9.4.5",
-        "@nestjs/apollo": "~13.0.4",
-        "@nestjs/common": "~11.0.12",
-        "@nestjs/core": "~11.0.12",
-        "@nestjs/graphql": "~13.0.4",
-        "@nestjs/platform-express": "~11.0.12",
-        "@nestjs/terminus": "~11.0.0",
-        "@nestjs/typeorm": "~11.0.0",
-        "@vendure/common": "3.2.3",
-        "bcrypt": "^5.1.1",
-        "body-parser": "^1.20.2",
-        "cookie-session": "^2.1.0",
-        "csv-parse": "^5.6.0",
-        "express": "^5.1.0",
-        "fs-extra": "^11.2.0",
-        "graphql": "^16.10.0",
-        "graphql-fields": "^2.0.3",
-        "graphql-scalars": "^1.24.0",
-        "graphql-tag": "^2.12.6",
-        "graphql-upload": "^17.0.0",
-        "http-proxy-middleware": "^3.0.3",
-        "i18next": "^24.2.3",
-        "i18next-fs-backend": "^2.6.0",
-        "i18next-http-middleware": "^3.7.2",
-        "i18next-icu": "^2.3.0",
-        "image-size": "^1.1.1",
-        "intl-messageformat": "^10.5.11",
-        "mime-types": "^2.1.35",
-        "ms": "^2.1.3",
-        "nanoid": "^3.3.8",
-        "picocolors": "^1.1.1",
-        "progress": "^2.0.3",
-        "reflect-metadata": "^0.2.2",
-        "rxjs": "^7.8.1",
-        "semver": "^7.6.0",
-        "typeorm": "^0.3.21"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/michaelbromley"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/accepts": {
-      "version": "1.3.8",
-      "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
-      "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "mime-types": "~2.1.34",
-        "negotiator": "0.6.3"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "packages/graphiql-plugin/node_modules/brace-expansion": {
       "version": "2.0.1",
       "dev": true,
@@ -41130,82 +40892,6 @@
         "balanced-match": "^1.0.0"
       }
     },
-    "packages/graphiql-plugin/node_modules/content-disposition": {
-      "version": "0.5.4",
-      "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
-      "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "safe-buffer": "5.2.1"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/cookie": {
-      "version": "0.7.1",
-      "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
-      "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/cookie-signature": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
-      "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "packages/graphiql-plugin/node_modules/debug": {
-      "version": "2.6.9",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
-      "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ms": "2.0.0"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/debug/node_modules/ms": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
-      "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
-      "dev": true,
-      "license": "MIT"
-    },
-    "packages/graphiql-plugin/node_modules/finalhandler": {
-      "version": "1.3.1",
-      "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
-      "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "2.6.9",
-        "encodeurl": "~2.0.0",
-        "escape-html": "~1.0.3",
-        "on-finished": "2.4.1",
-        "parseurl": "~1.3.3",
-        "statuses": "2.0.1",
-        "unpipe": "~1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/fresh": {
-      "version": "0.5.2",
-      "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
-      "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "packages/graphiql-plugin/node_modules/glob": {
       "version": "11.0.1",
       "dev": true,
@@ -41250,29 +40936,6 @@
         "node": "20 || >=22"
       }
     },
-    "packages/graphiql-plugin/node_modules/merge-descriptors": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
-      "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/mime": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
-      "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
-      "dev": true,
-      "license": "MIT",
-      "bin": {
-        "mime": "cli.js"
-      },
-      "engines": {
-        "node": ">=4"
-      }
-    },
     "packages/graphiql-plugin/node_modules/minimatch": {
       "version": "10.0.1",
       "dev": true,
@@ -41287,16 +40950,6 @@
         "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "packages/graphiql-plugin/node_modules/negotiator": {
-      "version": "0.6.3",
-      "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
-      "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "packages/graphiql-plugin/node_modules/path-scurry": {
       "version": "2.0.0",
       "dev": true,
@@ -41312,13 +40965,6 @@
         "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "packages/graphiql-plugin/node_modules/path-to-regexp": {
-      "version": "0.1.12",
-      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
-      "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
-      "dev": true,
-      "license": "MIT"
-    },
     "packages/graphiql-plugin/node_modules/react": {
       "version": "19.1.0",
       "dev": true,
@@ -41361,57 +41007,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "packages/graphiql-plugin/node_modules/send": {
-      "version": "0.19.0",
-      "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
-      "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "2.6.9",
-        "depd": "2.0.0",
-        "destroy": "1.2.0",
-        "encodeurl": "~1.0.2",
-        "escape-html": "~1.0.3",
-        "etag": "~1.8.1",
-        "fresh": "0.5.2",
-        "http-errors": "2.0.0",
-        "mime": "1.6.0",
-        "ms": "2.1.3",
-        "on-finished": "2.4.1",
-        "range-parser": "~1.2.1",
-        "statuses": "2.0.1"
-      },
-      "engines": {
-        "node": ">= 0.8.0"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/send/node_modules/encodeurl": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
-      "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "packages/graphiql-plugin/node_modules/serve-static": {
-      "version": "1.16.2",
-      "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
-      "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "encodeurl": "~2.0.0",
-        "escape-html": "~1.0.3",
-        "parseurl": "~1.3.3",
-        "send": "0.19.0"
-      },
-      "engines": {
-        "node": ">= 0.8.0"
-      }
-    },
     "packages/harden-plugin": {
       "name": "@vendure/harden-plugin",
       "version": "3.2.4",
@@ -41529,25 +41124,17 @@
         "@opentelemetry/resources": "^2.0.0",
         "@opentelemetry/sdk-logs": "^0.200.0",
         "@opentelemetry/sdk-node": "^0.200.0",
-        "@vendure/common": "3.2.2",
         "javascript-stringify": "^2.1.0"
       },
       "devDependencies": {
+        "@vendure/common": "3.2.4",
+        "@vendure/core": "3.2.4",
         "typescript": "5.8.2"
       },
       "funding": {
         "url": "https://github.com/sponsors/michaelbromley"
       }
     },
-    "packages/telemetry-plugin/node_modules/@vendure/common": {
-      "version": "3.2.2",
-      "resolved": "https://registry.npmjs.org/@vendure/common/-/common-3.2.2.tgz",
-      "integrity": "sha512-Eoh+Z2ezEiz4i/balGOSdLBKku3AD92F9sDagIFiSMx/3EuULE2jNAozAcbATh5zBxCXDTXgvEf7HoyrVwTZpA==",
-      "license": "GPL-3.0-or-later",
-      "funding": {
-        "url": "https://github.com/sponsors/michaelbromley"
-      }
-    },
     "packages/testing": {
       "name": "@vendure/testing",
       "version": "3.2.4",

+ 111 - 0
packages/graphiql-plugin/e2e/graphiql-plugin.e2e-spec.ts

@@ -0,0 +1,111 @@
+/* eslint-disable @typescript-eslint/no-non-null-assertion */
+import { ConfigService, LanguageCode, mergeConfig } from '@vendure/core';
+import { createTestEnvironment } from '@vendure/testing';
+import { afterAll, beforeAll, describe, expect, it } from 'vitest';
+
+import { TEST_SETUP_TIMEOUT_MS, testConfig } from '../../../e2e-common/test-config';
+import { GraphiQLService } from '../src/graphiql.service';
+import { GraphiqlPlugin } from '../src/plugin';
+
+describe('GraphiQLPlugin', () => {
+    let serviceInstance: GraphiQLService;
+    let configService: ConfigService;
+
+    const { server, adminClient } = createTestEnvironment(
+        mergeConfig(testConfig(), {
+            apiOptions: {
+                adminApiPlayground: true,
+                shopApiPlayground: true,
+            },
+            plugins: [GraphiqlPlugin.init()],
+        }),
+    );
+
+    beforeAll(async () => {
+        await server.init({
+            initialData: {
+                defaultLanguage: LanguageCode.en,
+                defaultZone: 'Europe/London',
+                countries: [],
+                taxRates: [],
+                paymentMethods: [],
+                shippingMethods: [],
+                collections: [],
+            },
+        });
+        await adminClient.asSuperAdmin();
+        configService = server.app.get(ConfigService);
+        serviceInstance = server.app.get(GraphiQLService);
+    }, TEST_SETUP_TIMEOUT_MS);
+
+    afterAll(async () => {
+        await server.destroy();
+    });
+
+    describe('configuration', () => {
+        it('should disable GraphQL playground in config', async () => {
+            expect(configService.apiOptions.adminApiPlayground).toBe(false);
+            expect(configService.apiOptions.shopApiPlayground).toBe(false);
+        });
+    });
+
+    describe('GraphiQLService', () => {
+        describe('getAdminApiUrl', () => {
+            it('should return the admin API URL', () => {
+                configService.apiOptions.adminApiPath = 'admin-api';
+                const url = serviceInstance.getAdminApiUrl();
+                expect(url).toBe('/admin-api');
+            });
+
+            it('should use default path if not specified', () => {
+                configService.apiOptions.adminApiPath = 'admin-api';
+                const url = serviceInstance.getAdminApiUrl();
+                expect(url).toBe('/admin-api');
+            });
+        });
+
+        describe('getShopApiUrl', () => {
+            it('should return the shop API URL', () => {
+                configService.apiOptions.shopApiPath = 'shop-api';
+                const url = serviceInstance.getShopApiUrl();
+                expect(url).toBe('/shop-api');
+            });
+
+            it('should use default path if not specified', () => {
+                configService.apiOptions.shopApiPath = 'shop-api';
+                const url = serviceInstance.getShopApiUrl();
+                expect(url).toBe('/shop-api');
+            });
+        });
+
+        describe('createApiUrl', () => {
+            it('should create a relative URL if no host is specified', () => {
+                configService.apiOptions.hostname = '';
+                configService.apiOptions.port = 3000;
+                const url = (serviceInstance as any).createApiUrl('test-api');
+                expect(url).toBe('/test-api');
+            });
+
+            it('should create an absolute URL if host is specified', () => {
+                configService.apiOptions.hostname = 'example.com';
+                configService.apiOptions.port = 3000;
+                const url = (serviceInstance as any).createApiUrl('test-api');
+                expect(url).toBe('http://example.com:3000/test-api');
+            });
+
+            it('should handle HTTPS hosts', () => {
+                configService.apiOptions.hostname = 'https://example.com';
+                configService.apiOptions.port = 443;
+                const url = (serviceInstance as any).createApiUrl('test-api');
+                expect(url).toBe('https://example.com:443/test-api');
+            });
+
+            it('should handle paths with leading slash', () => {
+                configService.apiOptions.hostname = 'example.com';
+                configService.apiOptions.port = 3000;
+                const url = (serviceInstance as any).createApiUrl('/test-api');
+                expect(url).toBe('http://example.com:3000/test-api');
+            });
+        });
+    });
+});

+ 4 - 3
packages/graphiql-plugin/package.json

@@ -17,7 +17,8 @@
         "build:app": "vite build",
         "dev": "vite",
         "lint": "eslint --fix .",
-        "test": "vitest --config vitest.config.mts --run"
+        "test": "vitest --config vitest.config.mts --run",
+        "e2e": "cross-env PACKAGE=graphiql-plugin vitest --config ../../e2e-common/vitest.config.mts --run"
     },
     "homepage": "https://www.vendure.io/",
     "funding": "https://github.com/sponsors/michaelbromley",
@@ -32,8 +33,8 @@
         "@types/express": "^5.0.0",
         "@types/react": "^19.0.0",
         "@types/react-dom": "^19.0.0",
-        "@vendure/common": "3.2.3",
-        "@vendure/core": "3.2.3",
+        "@vendure/common": "3.2.4",
+        "@vendure/core": "3.2.4",
         "@vitejs/plugin-react": "^4.3.4",
         "graphiql": "^3.8.3",
         "react": "^19.0.0",

+ 0 - 1
packages/graphiql-plugin/src/index.ts

@@ -3,6 +3,5 @@
  * The GraphiQL plugin exports a server plugin which serves
  * a GraphQL playground for the admin & shop APIs.
  */
-
 export * from './plugin';
 export * from './types';

+ 3 - 148
packages/graphiql-plugin/src/plugin.spec.ts

@@ -1,29 +1,17 @@
 /* eslint-disable @typescript-eslint/no-non-null-assertion */
 import { Test, TestingModule } from '@nestjs/testing';
 import { TypeOrmModule } from '@nestjs/typeorm';
-import { ConfigService, LanguageCode, Logger, PluginCommonModule, ProcessContext } from '@vendure/core';
-import {
-    createTestEnvironment,
-    registerInitializer,
-    SqljsInitializer,
-    testConfig,
-    TestEnvironment,
-    TestingLogger,
-} from '@vendure/testing';
+import { Logger, PluginCommonModule, ProcessContext } from '@vendure/core';
+import { TestingLogger } from '@vendure/testing';
 import express from 'express';
 import fs from 'fs';
-import path from 'path';
-import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, Mock, vi } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it, Mock, vi } from 'vitest';
 
 import { PLUGIN_INIT_OPTIONS } from './constants';
 import { GraphiQLService } from './graphiql.service';
 import { GraphiqlPlugin } from './plugin';
 import { GraphiqlPluginOptions } from './types';
 
-const sqliteDataDir = path.join(__dirname, '__data__');
-
-registerInitializer('sqljs', new SqljsInitializer(sqliteDataDir));
-
 // Use this type instead of NestJS's MiddlewareConsumer which is not exported
 interface MockMiddlewareConsumer {
     apply: Mock;
@@ -90,45 +78,6 @@ describe('GraphiQLPlugin', () => {
         });
     });
 
-    describe(
-        'configuration',
-        () => {
-            it('should disable GraphQL playground in config', async () => {
-                const result = createTestEnvironment({
-                    ...testConfig,
-                    apiOptions: {
-                        ...testConfig.apiOptions,
-                        adminApiPlayground: true,
-                        shopApiPlayground: true,
-                    },
-                    plugins: [GraphiqlPlugin.init()],
-                });
-
-                await result.server.init({
-                    initialData: {
-                        defaultLanguage: LanguageCode.en,
-                        defaultZone: 'Europe/London',
-                        countries: [],
-                        taxRates: [],
-                        paymentMethods: [],
-                        shippingMethods: [],
-                        collections: [],
-                    },
-                });
-
-                const configService = result.server.app.get(ConfigService);
-
-                expect(configService.apiOptions.adminApiPlayground).toBe(false);
-                expect(configService.apiOptions.shopApiPlayground).toBe(false);
-
-                await result.server.destroy();
-            });
-        },
-        {
-            timeout: 60000,
-        },
-    );
-
     describe('configure middleware', () => {
         it('should not configure middleware if not running in server', async () => {
             const plugin = await createPlugin(undefined, false);
@@ -376,100 +325,6 @@ describe('GraphiQLPlugin', () => {
     });
 });
 
-describe('GraphiQLService', () => {
-    let serviceInstance: GraphiQLService;
-    let configService: ConfigService;
-    let result: TestEnvironment;
-    beforeAll(async () => {
-        result = createTestEnvironment({
-            ...testConfig,
-            apiOptions: {
-                ...testConfig.apiOptions,
-                adminApiPlayground: true,
-                shopApiPlayground: true,
-            },
-            plugins: [GraphiqlPlugin.init()],
-        });
-
-        await result.server.init({
-            initialData: {
-                defaultLanguage: LanguageCode.en,
-                defaultZone: 'Europe/London',
-                countries: [],
-                taxRates: [],
-                paymentMethods: [],
-                shippingMethods: [],
-                collections: [],
-            },
-        });
-
-        configService = result.server.app.get(ConfigService);
-        serviceInstance = result.server.app.get(GraphiQLService);
-    });
-
-    afterAll(async () => {
-        await result.server.destroy();
-    });
-
-    describe('getAdminApiUrl', () => {
-        it('should return the admin API URL', () => {
-            configService.apiOptions.adminApiPath = 'admin-api';
-            const url = serviceInstance.getAdminApiUrl();
-            expect(url).toBe('/admin-api');
-        });
-
-        it('should use default path if not specified', () => {
-            configService.apiOptions.adminApiPath = 'admin-api';
-            const url = serviceInstance.getAdminApiUrl();
-            expect(url).toBe('/admin-api');
-        });
-    });
-
-    describe('getShopApiUrl', () => {
-        it('should return the shop API URL', () => {
-            configService.apiOptions.shopApiPath = 'shop-api';
-            const url = serviceInstance.getShopApiUrl();
-            expect(url).toBe('/shop-api');
-        });
-
-        it('should use default path if not specified', () => {
-            configService.apiOptions.shopApiPath = 'shop-api';
-            const url = serviceInstance.getShopApiUrl();
-            expect(url).toBe('/shop-api');
-        });
-    });
-
-    describe('createApiUrl', () => {
-        it('should create a relative URL if no host is specified', () => {
-            configService.apiOptions.hostname = '';
-            configService.apiOptions.port = 3000;
-            const url = (serviceInstance as any).createApiUrl('test-api');
-            expect(url).toBe('/test-api');
-        });
-
-        it('should create an absolute URL if host is specified', () => {
-            configService.apiOptions.hostname = 'example.com';
-            configService.apiOptions.port = 3000;
-            const url = (serviceInstance as any).createApiUrl('test-api');
-            expect(url).toBe('http://example.com:3000/test-api');
-        });
-
-        it('should handle HTTPS hosts', () => {
-            configService.apiOptions.hostname = 'https://example.com';
-            configService.apiOptions.port = 443;
-            const url = (serviceInstance as any).createApiUrl('test-api');
-            expect(url).toBe('https://example.com:443/test-api');
-        });
-
-        it('should handle paths with leading slash', () => {
-            configService.apiOptions.hostname = 'example.com';
-            configService.apiOptions.port = 3000;
-            const url = (serviceInstance as any).createApiUrl('/test-api');
-            expect(url).toBe('http://example.com:3000/test-api');
-        });
-    });
-});
-
 // Helper functions
 function createMockConsumer(): MockMiddlewareConsumer {
     return {

+ 2 - 1
packages/graphiql-plugin/src/plugin.ts

@@ -55,6 +55,7 @@ import { GraphiqlPluginOptions } from './types';
         config.apiOptions.shopApiPlayground = false;
         return config;
     },
+    exports: [GraphiQLService],
     compatibility: '^3.0.0',
 })
 export class GraphiqlPlugin implements NestModule {
@@ -74,7 +75,7 @@ export class GraphiqlPlugin implements NestModule {
             ...options,
             route: options.route || 'graphiql',
         };
-        return this;
+        return GraphiqlPlugin;
     }
 
     configure(consumer: MiddlewareConsumer) {