From 77a02284772b95b4c03f69e361c3d30778bf40cc Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Tue, 10 Oct 2023 18:26:52 +0300 Subject: [PATCH 1/5] Introduce Apollo v4 support & Drop Apollo v2/v3 and Node 16 support --- .changeset/dull-camels-grow.md | 5 + .changeset/heavy-owls-look.md | 17 + .github/workflows/tests.yml | 4 +- benchmark/basic.case.ts | 50 +- .../apollo-subscriptions/src/app/index.ts | 7 +- examples/apollo-subscriptions/src/index.ts | 39 +- .../src/index.ts | 33 +- examples/basic/src/index.ts | 32 +- examples/graphql-yoga/src/app/post/pubsub.ts | 4 +- examples/graphql-yoga/src/index.ts | 9 +- package.json | 9 +- packages/graphql-modules/package.json | 1 - .../graphql-modules/src/application/apollo.ts | 157 ++--- .../src/application/application.ts | 12 +- .../graphql-modules/src/application/types.ts | 13 +- .../src/testing/test-application.ts | 7 +- .../tests/di-providers.spec.ts | 96 --- .../graphql-modules/tests/federation.spec.ts | 2 +- .../tests/third-parties.spec.ts | 35 +- .../src/pages/docs/advanced/subscriptions.mdx | 166 ++--- website/src/pages/docs/api.mdx | 2 +- website/src/pages/docs/get-started.mdx | 84 ++- yarn.lock | 596 ++++++++++-------- 23 files changed, 642 insertions(+), 738 deletions(-) create mode 100644 .changeset/dull-camels-grow.md create mode 100644 .changeset/heavy-owls-look.md diff --git a/.changeset/dull-camels-grow.md b/.changeset/dull-camels-grow.md new file mode 100644 index 0000000000..7ea1bf3040 --- /dev/null +++ b/.changeset/dull-camels-grow.md @@ -0,0 +1,5 @@ +--- +'graphql-modules': minor +--- + +Introduce `createApolloGateway` for Apollo Server v4 diff --git a/.changeset/heavy-owls-look.md b/.changeset/heavy-owls-look.md new file mode 100644 index 0000000000..a9ebe532a2 --- /dev/null +++ b/.changeset/heavy-owls-look.md @@ -0,0 +1,17 @@ +--- +'graphql-modules': major +--- + +Drop Node 16 and Apollo v2 and v3 support + +`createApolloExecutor` and `createSchemaForApollo` have been removed in favor of `createApolloGateway`. + +You can create `gateway` instance for Apollo Server v4 like this, and pass it directly to `ApolloServer` constructor. You don't need to pass `schema` or `executor` anymore. + +```ts +const gateway = application.createApolloGateway() + +const apolloServer = new ApolloServer({ + gateway +}) +``` diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c195154ad3..69fe76b0a7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] # remove windows to speed up the tests - node-version: [12, 16, 18] + node-version: [18, 20] graphql_version: - 15 - 16 @@ -49,7 +49,7 @@ jobs: - name: Setup env uses: the-guild-org/shared-config/setup@main with: - nodeVersion: 18 + nodeVersion: 20 - name: Use GraphQL v${{matrix.graphql_version}} run: node ./scripts/match-graphql.js ${{matrix.graphql_version}} - name: Cache Jest diff --git a/benchmark/basic.case.ts b/benchmark/basic.case.ts index 8cc1ad09aa..9b1527c76d 100644 --- a/benchmark/basic.case.ts +++ b/benchmark/basic.case.ts @@ -96,30 +96,36 @@ let showedError = false; const executeAppWithDI = appWithDI.createExecution(); const executeApp = app.createExecution(); -const apolloWithDIExecutor = appWithDI.createApolloExecutor(); +const apolloGWWithDI = appWithDI.createApolloGateway(); +const apolloGWWithDILoadResult$ = apolloGWWithDI.load(); const executeApolloWithDI = (args: ExecutionArgs) => { - return apolloWithDIExecutor({ - schema: args.schema, - document: args.document, - operationName: args.operationName, - context: args.contextValue, - request: { - variables: args.variableValues, - }, - }); + return apolloGWWithDILoadResult$.then(({ executor }) => + executor({ + schema: args.schema, + document: args.document, + operationName: args.operationName, + context: args.contextValue, + request: { + variables: args.variableValues, + }, + }) + ); }; -const apolloExecutor = app.createApolloExecutor(); +const apolloGW = app.createApolloGateway(); +const apolloGWLoadResult$ = apolloGW.load(); const executeApollo = (args: ExecutionArgs) => { - return apolloExecutor({ - schema: args.schema, - document: args.document, - operationName: args.operationName, - context: args.contextValue, - request: { - variables: args.variableValues, - }, - }); + return apolloGWLoadResult$.then(({ executor }) => + executor({ + schema: args.schema, + document: args.document, + operationName: args.operationName, + context: args.contextValue, + request: { + variables: args.variableValues, + }, + }) + ); }; const query = parse(/* GraphQL */ ` @@ -162,11 +168,11 @@ const suites: Record = { }, 'apollo-with-id': { name: 'ApolloServer (DI)', - runner: () => graphql(appWithDI.schema, executeApolloWithDI as any), + runner: () => graphql(appWithDI.schema, executeApolloWithDI), }, apollo: { name: 'ApolloServer', - runner: () => graphql(app.schema, executeApollo as any), + runner: () => graphql(app.schema, executeApollo), }, }; diff --git a/examples/apollo-subscriptions/src/app/index.ts b/examples/apollo-subscriptions/src/app/index.ts index 24d9ed5a3a..d221147a87 100644 --- a/examples/apollo-subscriptions/src/app/index.ts +++ b/examples/apollo-subscriptions/src/app/index.ts @@ -4,5 +4,10 @@ import { PostModule } from './post/post.module'; export const graphqlApplication = createApplication({ modules: [PostModule], - providers: [PubSub], + providers: [ + { + provide: PubSub, + useValue: new PubSub(), + }, + ], }); diff --git a/examples/apollo-subscriptions/src/index.ts b/examples/apollo-subscriptions/src/index.ts index 0f7da36016..a94614e331 100644 --- a/examples/apollo-subscriptions/src/index.ts +++ b/examples/apollo-subscriptions/src/index.ts @@ -1,24 +1,26 @@ import 'reflect-metadata'; import express from 'express'; import { createServer } from 'http'; -import { ApolloServer } from 'apollo-server-express'; -import { ApolloServerPluginDrainHttpServer } from 'apollo-server-core'; +import { ApolloServer } from '@apollo/server'; +import { expressMiddleware } from '@apollo/server/express4'; +import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'; import { graphqlApplication } from './app'; import { WebSocketServer } from 'ws'; import { useServer } from 'graphql-ws/lib/use/ws'; +import bodyParser from 'body-parser'; +import cors from 'cors'; -const { schema, createExecution, createSubscription, createApolloExecutor } = +const { schema, createExecution, createSubscription, createApolloGateway } = graphqlApplication; -const executor = createApolloExecutor(); +const gateway = createApolloGateway(); const app = express(); const httpServer = createServer(app); // Creating the WebSocket subscription server const server = new ApolloServer({ - schema, - executor, + gateway, plugins: [ // Proper shutdown for the HTTP server. ApolloServerPluginDrainHttpServer({ httpServer }), @@ -35,11 +37,9 @@ const server = new ApolloServer({ ], }); -server.applyMiddleware({ app }); - const wsServer = new WebSocketServer({ server: httpServer, - path: server.graphqlPath, + path: '/graphql', }); const execute = createExecution(); @@ -49,7 +49,24 @@ const subscribe = createSubscription(); // telling the WebSocketServer to start listening const serverCleanup = useServer({ schema, execute, subscribe }, wsServer); -httpServer.listen({ port: 4000 }, () => { +async function main() { + await server.start(); + + app.use( + '/graphql', + cors(), + bodyParser.json(), + expressMiddleware(server) + ); + + httpServer.listen({ port: 4000 }, () => { + // tslint:disable-next-line: no-console + console.info(`🚀 Server ready at http://localhost:4000/graphql`); + }); +} + +main().catch((error) => { // tslint:disable-next-line: no-console - console.info(`🚀 Server ready at http://localhost:4000${server.graphqlPath}`); + console.error(error); + process.exit(1); }); diff --git a/examples/basic-with-dependency-injection/src/index.ts b/examples/basic-with-dependency-injection/src/index.ts index 6ebd024b96..98b98af9b3 100644 --- a/examples/basic-with-dependency-injection/src/index.ts +++ b/examples/basic-with-dependency-injection/src/index.ts @@ -2,26 +2,27 @@ import 'reflect-metadata'; import { createApplication } from 'graphql-modules'; import { BlogModule } from './modules/blog'; import { UserModule } from './modules/user'; -import express from 'express'; -import { graphqlHTTP } from 'express-graphql'; +import http from 'http'; +import { createHandler } from 'graphql-http/lib/use/http'; const app = createApplication({ modules: [BlogModule, UserModule], }); -const server = express(); - -const execute = app.createExecution(); - -server.use( - '/graphql', - graphqlHTTP({ - schema: app.schema, - customExecuteFn: execute as any, - graphiql: true, - }) -); +// Create the GraphQL over HTTP Node request handler +const handler = createHandler({ + schema: app.schema, + execute: app.createExecution(), +}); -server.listen(4000, () => { - console.log('Live http://localhost:4000/graphql'); +// Create a HTTP server using the listener on `/graphql` +const server = http.createServer((req, res) => { + if (req.url?.startsWith('/graphql')) { + handler(req, res); + } else { + res.writeHead(404).end(); + } }); + +server.listen(4000); +console.log('Listening to port 4000'); diff --git a/examples/basic/src/index.ts b/examples/basic/src/index.ts index 002e1a38c5..7c7f647e1f 100644 --- a/examples/basic/src/index.ts +++ b/examples/basic/src/index.ts @@ -8,28 +8,30 @@ declare global { import 'reflect-metadata'; import { createApplication } from 'graphql-modules'; -import express from 'express'; -import { graphqlHTTP } from 'express-graphql'; +import http from 'http'; +import { createHandler } from 'graphql-http/lib/use/http'; import { UserModule } from './app/user/user.module'; import { AuthModule } from './app/auth/auth.module'; import { SocialNetworkModule } from './app/social-network/social-network.module'; -const server = express(); const app = createApplication({ modules: [UserModule, AuthModule, SocialNetworkModule], }); -const execute = app.createExecution(); -server.use( - '/graphql', - graphqlHTTP((request: any) => ({ - schema: app.schema, - graphiql: true, - customExecuteFn: execute as any, - context: { request }, - })) -); +// Create the GraphQL over HTTP Node request handler +const handler = createHandler({ + schema: app.schema, + execute: app.createExecution(), +}); -server.listen(4000, () => { - console.log('Live http://localhost:4000/graphql'); +// Create a HTTP server using the listener on `/graphql` +const server = http.createServer((req, res) => { + if (req.url?.startsWith('/graphql')) { + handler(req, res); + } else { + res.writeHead(404).end(); + } }); + +server.listen(4000); +console.log('Listening to port 4000'); diff --git a/examples/graphql-yoga/src/app/post/pubsub.ts b/examples/graphql-yoga/src/app/post/pubsub.ts index 2af0e2d3f5..7432235f8c 100644 --- a/examples/graphql-yoga/src/app/post/pubsub.ts +++ b/examples/graphql-yoga/src/app/post/pubsub.ts @@ -1,12 +1,12 @@ import { InjectionToken, FactoryProvider, Scope } from 'graphql-modules'; -import { createPubSub, PubSub as TPubSub } from '@graphql-yoga/node'; +import { createPubSub, PubSub as TPubSub } from 'graphql-yoga'; import { Post } from './types'; type PubSub = TPubSub<{ POST_ADDED: [ { postAdded: Post; - } + }, ]; }>; diff --git a/examples/graphql-yoga/src/index.ts b/examples/graphql-yoga/src/index.ts index 7430dbe225..ed89a0567c 100644 --- a/examples/graphql-yoga/src/index.ts +++ b/examples/graphql-yoga/src/index.ts @@ -1,13 +1,16 @@ import 'reflect-metadata'; -import { createServer } from '@graphql-yoga/node'; +import { createServer } from 'http'; +import { createYoga } from 'graphql-yoga'; import { useGraphQLModules } from '@envelop/graphql-modules'; import { app } from './app'; -const server = createServer({ +const yoga = createYoga({ plugins: [useGraphQLModules(app)], }); -server.start().then(() => { +const server = createServer(yoga); + +server.listen(4000, () => { // tslint:disable-next-line: no-console console.info(`🚀 Server ready at http://localhost:4000/graphql`); }); diff --git a/package.json b/package.json index 1fd561e589..213c73c29e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "deploy-website": "cd website && yarn && yarn build && mkdir graphql-modules && mv build/* graphql-modules && mv graphql-modules build" }, "devDependencies": { - "@apollo/federation": "0.38.1", + "@apollo/subgraph": "2.5.5", + "@apollo/server": "4.9.4", "@babel/core": "7.23.2", "@babel/preset-env": "7.23.2", "@babel/preset-typescript": "7.23.2", @@ -34,10 +35,10 @@ "@changesets/changelog-github": "0.4.8", "@envelop/graphql-modules": "5.0.3", "@graphql-tools/merge": "9.0.0", - "@graphql-yoga/node": "3.9.1", "@types/benchmark": "2.1.4", "graphql-jit": "0.8.4", "@types/express": "4.17.20", + "@types/cors": "2.8.14", "@types/jest": "27.5.2", "@types/node": "18.18.7", "@types/ramda": "0.29.7", @@ -53,14 +54,16 @@ "babel-jest": "29.7.0", "bob-the-bundler": "1.7.3", "chalk": "4.1.2", + "cors": "2.8.5", "dataloader": "2.2.2", "eslint": "8.52.0", "express": "4.18.2", - "express-graphql": "0.12.0", + "graphql-http": "1.22.0", "globby": "11.1.0", "graphql": "16.8.1", "graphql-subscriptions": "2.0.0", "graphql-ws": "5.14.2", + "graphql-yoga": "4.0.5", "husky": "8.0.3", "jest": "27.5.1", "lint-staged": "14.0.1", diff --git a/packages/graphql-modules/package.json b/packages/graphql-modules/package.json index ec90c38c91..bc5ace6341 100644 --- a/packages/graphql-modules/package.json +++ b/packages/graphql-modules/package.json @@ -38,7 +38,6 @@ }, "dependencies": { "@graphql-tools/schema": "^10.0.0", - "@graphql-tools/wrap": "^10.0.0", "@graphql-typed-document-node/core": "^3.1.0", "ramda": "^0.29.0" }, diff --git a/packages/graphql-modules/src/application/apollo.ts b/packages/graphql-modules/src/application/apollo.ts index 6f51654dfa..cb5cd6bad6 100644 --- a/packages/graphql-modules/src/application/apollo.ts +++ b/packages/graphql-modules/src/application/apollo.ts @@ -1,12 +1,12 @@ -import { wrapSchema } from '@graphql-tools/wrap'; -import { DocumentNode, execute, GraphQLSchema } from 'graphql'; -import { uniqueId } from '../shared/utils'; -import { InternalAppContext } from './application'; -import { ExecutionContextBuilder } from './context'; +import { + DocumentNode, + ExecutionResult, + GraphQLSchema, + concatAST, + print, +} from 'graphql'; import { Application } from './types'; -const CONTEXT_ID = Symbol.for('context-id'); - export interface ApolloRequestContext { document: DocumentNode; operationName?: string | null; @@ -17,109 +17,58 @@ export interface ApolloRequestContext { }; } -export function apolloExecutorCreator({ - createExecution, -}: { - createExecution: Application['createExecution']; -}): Application['createApolloExecutor'] { - return function createApolloExecutor(options) { - const executor = createExecution(options); - return async function executorAdapter( - requestContext: ApolloRequestContext - ) { - return executor({ - schema: requestContext.schema, - document: requestContext.document, - operationName: requestContext.operationName, - variableValues: requestContext.request.variables, - contextValue: requestContext.context, - }); - }; - }; +export interface ApolloGatewayLoadResult { + executor: ApolloExecutor; } -export function apolloSchemaCreator({ - createSubscription, - contextBuilder, - schema, -}: { - createSubscription: Application['createSubscription']; - contextBuilder: ExecutionContextBuilder; - schema: GraphQLSchema; -}) { - const createApolloSchema = () => { - const sessions: Record< - string, - { - count: number; - session: { - destroy(): void; - context: InternalAppContext; - }; - } - > = {}; - const subscription = createSubscription(); +export type ApolloExecutor = ( + requestContext: ApolloRequestContext +) => Promise; - function getSession(ctx: any) { - if (!ctx[CONTEXT_ID]) { - ctx[CONTEXT_ID] = uniqueId((id) => !sessions[id]); - const { context, ɵdestroy: destroy } = contextBuilder(ctx); +export interface ApolloGatewayInterface { + onSchemaLoadOrUpdate( + callback: (schemaContext: { + apiSchema: GraphQLSchema; + coreSupergraphSdl: string; + }) => void + ): () => void; + load(): Promise; + stop(): Promise; +} - sessions[ctx[CONTEXT_ID]] = { - count: 0, - session: { - context, - destroy() { - if (--sessions[ctx[CONTEXT_ID]].count === 0) { - destroy(); - delete sessions[ctx[CONTEXT_ID]]; - delete ctx[CONTEXT_ID]; - } - }, +export function apolloGatewayCreator({ + schema, + typeDefs, + createExecution, +}: { + schema: Application['schema']; + typeDefs: Application['typeDefs']; + createExecution: Application['createExecution']; +}): Application['createApolloGateway'] { + return function createApolloGateway(options) { + const executor = createExecution(options); + return { + onSchemaLoadOrUpdate(callback) { + callback({ + apiSchema: schema, + coreSupergraphSdl: print(concatAST(typeDefs)), + }); + return () => {}; + }, + async load() { + return { + async executor(requestContext: ApolloRequestContext) { + return executor({ + schema: requestContext.schema, + document: requestContext.document, + operationName: requestContext.operationName, + variableValues: requestContext.request.variables, + contextValue: requestContext.context, + }); }, }; - } - - sessions[ctx[CONTEXT_ID]].count++; - - return sessions[ctx[CONTEXT_ID]].session; - } - - return wrapSchema({ - schema, - batch: true, - executor(input) { - if (input.operationType === 'subscription') { - return subscription({ - schema, - document: input.document, - variableValues: input.variables as any, - contextValue: input.context, - rootValue: input.rootValue, - operationName: input.operationName, - }); - } - // Create an execution context - const { context, destroy } = getSession(input.context!); - - // It's important to wrap the executeFn within a promise - // so we can easily control the end of execution (with finally) - return Promise.resolve() - .then( - () => - execute({ - schema, - document: input.document, - contextValue: context, - variableValues: input.variables as any, - rootValue: input.rootValue, - operationName: input.operationName, - }) as any - ) - .finally(destroy); }, - }); + async stop() {}, + }; }; - - return createApolloSchema; } diff --git a/packages/graphql-modules/src/application/application.ts b/packages/graphql-modules/src/application/application.ts index f5d7fb25be..4b55204a5f 100644 --- a/packages/graphql-modules/src/application/application.ts +++ b/packages/graphql-modules/src/application/application.ts @@ -21,7 +21,7 @@ import { import { createContextBuilder } from './context'; import { executionCreator } from './execution'; import { subscriptionCreator } from './subscription'; -import { apolloSchemaCreator, apolloExecutorCreator } from './apollo'; +import { apolloGatewayCreator } from './apollo'; import { operationControllerCreator } from './operation-controller'; import { Module } from '../module/types'; @@ -132,12 +132,9 @@ export function createApplication( }); const createSubscription = subscriptionCreator({ contextBuilder }); const createExecution = executionCreator({ contextBuilder }); - const createSchemaForApollo = apolloSchemaCreator({ - createSubscription, - contextBuilder, + const createApolloGateway = apolloGatewayCreator({ schema, - }); - const createApolloExecutor = apolloExecutorCreator({ + typeDefs, createExecution, }); @@ -154,8 +151,7 @@ export function createApplication( createOperationController, createSubscription, createExecution, - createSchemaForApollo, - createApolloExecutor, + createApolloGateway, ɵfactory: applicationFactory, ɵconfig: config, }; diff --git a/packages/graphql-modules/src/application/types.ts b/packages/graphql-modules/src/application/types.ts index 18191b42d5..4e00fb0919 100644 --- a/packages/graphql-modules/src/application/types.ts +++ b/packages/graphql-modules/src/application/types.ts @@ -8,7 +8,7 @@ import { import type { Provider, Injector } from '../di'; import type { Resolvers, Module, MockedModule } from '../module/types'; import type { MiddlewareMap } from '../shared/middleware'; -import type { ApolloRequestContext } from './apollo'; +import type { ApolloGatewayInterface, ApolloRequestContext } from './apollo'; import type { Single } from '../shared/types'; import type { InternalAppContext } from './application'; @@ -67,16 +67,9 @@ export interface Application { execute?: typeof execute; controller?: OperationController; }): Execution; - /** - * @deprecated Use `createApolloExecutor`, `createExecution` and `createSubscription` methods instead. - */ - createSchemaForApollo(): GraphQLSchema; - /** - * Experimental - */ - createApolloExecutor(options?: { + createApolloGateway(options?: { controller?: OperationController; - }): ApolloExecutor; + }): ApolloGatewayInterface; /** * @internal */ diff --git a/packages/graphql-modules/src/testing/test-application.ts b/packages/graphql-modules/src/testing/test-application.ts index 2face6b984..4d832498a0 100644 --- a/packages/graphql-modules/src/testing/test-application.ts +++ b/packages/graphql-modules/src/testing/test-application.ts @@ -33,11 +33,8 @@ export function mockApplication(app: Application): MockedApplication { createExecution(options) { return sharedFactory().createExecution(options); }, - createSchemaForApollo() { - return sharedFactory().createSchemaForApollo(); - }, - createApolloExecutor() { - return sharedFactory().createApolloExecutor(); + createApolloGateway() { + return sharedFactory().createApolloGateway(); }, get ɵfactory() { return sharedFactory().ɵfactory; diff --git a/packages/graphql-modules/tests/di-providers.spec.ts b/packages/graphql-modules/tests/di-providers.spec.ts index a9942ab3b6..feb91d2f9e 100644 --- a/packages/graphql-modules/tests/di-providers.spec.ts +++ b/packages/graphql-modules/tests/di-providers.spec.ts @@ -11,7 +11,6 @@ import { gql, testkit, } from '../src'; -import { execute } from 'graphql'; import { ExecutionContext } from '../src/di'; const Test = new InjectionToken('test'); @@ -542,101 +541,6 @@ test('Operation scoped provider should be created once per GraphQL Operation', a expect(loadSpy).toHaveBeenCalledWith(1); }); -test('Operation scoped provider should be created once per GraphQL Operation (Apollo Server)', async () => { - const constructorSpy = jest.fn(); - const loadSpy = jest.fn(); - - @Injectable({ - scope: Scope.Operation, - }) - class Dataloader { - constructor(@Inject(CONTEXT) context: GraphQLModulesGlobalContext) { - constructorSpy(context); - } - - load(id: number) { - loadSpy(id); - return { - id, - title: 'Sample Title', - }; - } - } - - const postsModule = createModule({ - id: 'posts', - providers: [Dataloader], - typeDefs: gql` - type Post { - id: Int! - title: String! - } - - type Query { - post(id: Int!): Post! - } - `, - resolvers: { - Query: { - post( - _parent: {}, - args: { id: number }, - { injector }: GraphQLModulesModuleContext - ) { - return injector.get(Dataloader).load(args.id); - }, - }, - }, - }); - - const app = createApplication({ - modules: [postsModule], - }); - - const schema = app.createSchemaForApollo(); - - const contextValue = { request: {}, response: {} }; - const document = gql` - { - foo: post(id: 1) { - id - title - } - bar: post(id: 1) { - id - title - } - } - `; - - const result = await execute({ - schema, - contextValue, - document, - }); - - // Should resolve data correctly - expect(result.errors).toBeUndefined(); - expect(result.data).toEqual({ - foo: { - id: 1, - title: 'Sample Title', - }, - bar: { - id: 1, - title: 'Sample Title', - }, - }); - - expect(constructorSpy).toHaveBeenCalledTimes(1); - expect(constructorSpy).toHaveBeenCalledWith( - expect.objectContaining(contextValue) - ); - - expect(loadSpy).toHaveBeenCalledTimes(2); - expect(loadSpy).toHaveBeenCalledWith(1); -}); - test('Singleton scoped provider should be created once', async () => { const constructorSpy = jest.fn(); diff --git a/packages/graphql-modules/tests/federation.spec.ts b/packages/graphql-modules/tests/federation.spec.ts index f3b937ca2b..d2100f65ac 100644 --- a/packages/graphql-modules/tests/federation.spec.ts +++ b/packages/graphql-modules/tests/federation.spec.ts @@ -14,7 +14,7 @@ describe('federation', () => { const { buildSubgraphSchema, - }: typeof import('@apollo/federation') = require('@apollo/federation'); + }: typeof import('@apollo/subgraph') = require('@apollo/subgraph'); test('allow __resolveReference', async () => { const mod = createModule({ diff --git a/packages/graphql-modules/tests/third-parties.spec.ts b/packages/graphql-modules/tests/third-parties.spec.ts index a292141327..8db88f9960 100644 --- a/packages/graphql-modules/tests/third-parties.spec.ts +++ b/packages/graphql-modules/tests/third-parties.spec.ts @@ -6,7 +6,7 @@ import { Injectable, Scope, } from '../src'; -import { ApolloServer } from 'apollo-server-express'; +import { ApolloServer } from '@apollo/server'; describe('Apollo Server', () => { test('cacheControl available in info object', async () => { @@ -31,9 +31,7 @@ describe('Apollo Server', () => { modules: [mod], }); const apollo = new ApolloServer({ - typeDefs: app.typeDefs, - resolvers: app.resolvers, - executor: app.createApolloExecutor(), + gateway: app.createApolloGateway(), }); const response = await apollo.executeOperation({ @@ -45,8 +43,10 @@ describe('Apollo Server', () => { operationName: 'foo', }); - expect(response.errors).toBeUndefined(); - expect(response.data?.foo).toBe(true); + assertResponseType(response.body, 'single'); + + expect(response.body.singleResult.errors).toBeUndefined(); + expect(response.body.singleResult.data?.foo).toBe(true); expect(spy).toHaveBeenCalledWith( expect.objectContaining({ setCacheHint: expect.any(Function), @@ -54,7 +54,7 @@ describe('Apollo Server', () => { ); }); - test('createApolloExecutor should instantiate operation-scoped provider once per many fields', async () => { + test('createApolloGateway should instantiate operation-scoped provider once per many fields', async () => { const constructor = jest.fn(); const log = jest.fn(); @@ -115,12 +115,10 @@ describe('Apollo Server', () => { }); const apollo = new ApolloServer({ - typeDefs: app.typeDefs, - resolvers: app.resolvers, - executor: app.createApolloExecutor(), + gateway: app.createApolloGateway(), }); - const result = await apollo.executeOperation({ + const response = await apollo.executeOperation({ query: /* GraphQL */ ` mutation m { m1 @@ -130,8 +128,10 @@ describe('Apollo Server', () => { operationName: 'm', }); - expect(result.errors).toBeUndefined(); - expect(result.data).toEqual({ + assertResponseType(response.body, 'single'); + + expect(response.body.singleResult.errors).toBeUndefined(); + expect(response.body.singleResult.data).toEqual({ m1: 'm1', m2: 'm2', }); @@ -140,3 +140,12 @@ describe('Apollo Server', () => { expect(log).toBeCalledTimes(2); }); }); + +export function assertResponseType( + received: { kind: string }, + kind: T +): asserts received is { kind: T } { + if (received.kind !== kind) { + throw new Error(`Expected ${received.kind} to be ${kind}`); + } +} diff --git a/website/src/pages/docs/advanced/subscriptions.mdx b/website/src/pages/docs/advanced/subscriptions.mdx index aec9d4e903..aaec54d0d0 100644 --- a/website/src/pages/docs/advanced/subscriptions.mdx +++ b/website/src/pages/docs/advanced/subscriptions.mdx @@ -133,20 +133,23 @@ export const myModule = createModule({ Here are reference implementations of using GraphQL Subscriptions with WebSockets in both, Apollo Server and Express GraphQL. - - + + ```ts filename="server.ts" import 'reflect-metadata' -import { createServer } from '@graphql-yoga/node' +import { createServer } from 'http' +import { createYoga } from 'graphql-yoga' import { useGraphQLModules } from '@envelop/graphql-modules' import { application } from './application' -const server = createServer({ +const yoga = createYoga({ plugins: [useGraphQLModules(application)] }) -server.start().then(() => { - console.log(`🚀 Server ready`) +const server = createServer(yoga) + +server.listen(4000, () => { + console.log(`🚀 Server ready at http://localhost:4000/graphql`) }) ``` @@ -160,107 +163,74 @@ server.start().then(() => { ```ts filename="server.ts" -import 'reflect-metadata' -import express from 'express' -import { createServer } from 'node:http' -import { SubscriptionServer } from 'subscriptions-transport-ws' -import { ApolloServer } from 'apollo-server-express' -import { application } from './application' - -const schema = application.createSchemaForApollo() - -const { schema, createExecution, createSubscription, createApolloExecutor } = - application -const execute = createExecution() -const subscribe = createSubscription() - -;(async function () { - const app = express() - - const httpServer = createServer(app) - - let subscriptionServer - const server = new ApolloServer({ - schema, - executor: createApolloExecutor(), - plugins: [ - { - serverWillStart() { - return { - drainServer() { - subscriptionServer.close() - } - } - } - } - ] - }) - - subscriptionServer = SubscriptionServer.create( +import 'reflect-metadata'; +import express from 'express'; +import { createServer } from 'http'; +import { ApolloServer } from '@apollo/server'; +import { expressMiddleware } from '@apollo/server/express4'; +import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'; +import { graphqlApplication } from './app'; +import { WebSocketServer } from 'ws'; +import { useServer } from 'graphql-ws/lib/use/ws'; +import bodyParser from 'body-parser'; +import cors from 'cors'; + +const { schema, createExecution, createSubscription, createApolloGateway } = + graphqlApplication; + +const gateway = createApolloGateway(); + +const app = express(); +const httpServer = createServer(app); +// Creating the WebSocket subscription server + +const server = new ApolloServer({ + gateway, + plugins: [ + // Proper shutdown for the HTTP server. + ApolloServerPluginDrainHttpServer({ httpServer }), + // Proper shutdown for the WebSocket server. { - schema, - execute, - subscribe + async serverWillStart() { + return { + async drainServer() { + await serverCleanup.dispose(); + }, + }; + }, }, - { - server: httpServer, - path: server.graphqlPath - } - ) + ], +}); - await server.start() - server.applyMiddleware({ app }) - - const PORT = 4000 - httpServer.listen(PORT, () => - console.log(`Server is now running on http://localhost:${PORT}/graphql`) - ) -})() -``` - +const wsServer = new WebSocketServer({ + server: httpServer, + path: '/graphql', +}); - -```ts filename="server.ts" -import 'reflect-metadata' -import express from 'express' -import graphqlHTTP from 'express-graphql' -import { createServer } from 'node:http' -import { SubscriptionServer } from 'subscriptions-transport-ws' -import { application } from './application' +const execute = createExecution(); +const subscribe = createSubscription(); -const execute = application.createExecution() -const subscribe = application.createSubscription() -const { schema } = application +// Passing in an instance of a GraphQLSchema and +// telling the WebSocketServer to start listening +const serverCleanup = useServer({ schema, execute, subscribe }, wsServer); -const server = express() +async function main() { + await server.start(); -server.use( - '/', - graphqlHTTP({ - schema, - customExecuteFn: execute, - graphiql: true - }) -) + app.use('/graphql', cors(), bodyParser.json(), expressMiddleware(server)); -const webServer = createServer(app) -webServer.listen(4000, () => { - console.log('🚀 Server ready at http://localhost:4000') + httpServer.listen({ port: 4000 }, () => { + // tslint:disable-next-line: no-console + console.info(`🚀 Server ready at http://localhost:4000/graphql`); + }); +} - new SubscriptionServer( - { - execute, - subscribe, - schema - }, - { - server: webServer, - path: '/' - } - ) -}) +main().catch((error) => { + // tslint:disable-next-line: no-console + console.error(error); + process.exit(1); +}); ``` - - + diff --git a/website/src/pages/docs/api.mdx b/website/src/pages/docs/api.mdx index 3869563061..29abe8f3b0 100644 --- a/website/src/pages/docs/api.mdx +++ b/website/src/pages/docs/api.mdx @@ -47,7 +47,7 @@ A return type of `createApplication` function. Important when using GraphQL Subscriptions. - `createExecution` - Creates a `execute` function that runs the execution phase of GraphQL. Important when using GraphQL Queries and Mutations. -- `createApolloExecutor` - Creates an `executor` for `ApolloServer` +- `createApolloGateway` - Creates a `gateway` for `ApolloServer` ## `ApplicationConfig` diff --git a/website/src/pages/docs/get-started.mdx b/website/src/pages/docs/get-started.mdx index fe2e0ee482..02fe75fb40 100644 --- a/website/src/pages/docs/get-started.mdx +++ b/website/src/pages/docs/get-started.mdx @@ -91,76 +91,68 @@ GraphQL-Modules allow you to do much more, like managing the lifecycle of your e Your GraphQL `Application` exposes `createExecution` and `createSubscription` methods, which are just plug-and-play replacements for the default functions from `graphql-js`. - - + + If you are using [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server), you can use [`useGraphQLModules`](https://envelop.dev/plugins/use-graphql-modules) plugin from Envelop. ```ts -import { createServer } from '@graphql-yoga/node' +import { createServer } from 'http' +import { createYoga } from 'graphql-yoga' import { useGraphQLModules } from '@envelop/graphql-modules' import { application } from './application' -const server = createServer({ +const yoga = createYoga({ plugins: [useGraphQLModules(application)] }) -server.start().then(() => { - console.log(`🚀 Server ready`) +const server = createServer(yoga) + +server.listen(4000, () => { + console.log(`🚀 Server ready at http://localhost:4000/`) }) ``` - - - -If you are using [Apollo-Server](https://github.com/apollographql/apollo-server), you can use `createApolloExecutor` to get an executor that is adapted for this server, and integrates with it perfectly. + +If you are using [Apollo-Server](https://github.com/apollographql/apollo-server), you can use `createApolloGateway` to get an executor that is adapted for this server, and integrates with it perfectly. ```ts -import { ApolloServer } from 'apollo-server' +import { ApolloServer } from '@apollo/server' import { application } from './application' -const executor = application.createApolloExecutor() -const schema = application.schema +const gateway = application.createApolloGateway() -const server = new ApolloServer({ schema, executor }) - -server.listen().then(({ url }) => { - console.log(`🚀 Server ready at ${url}`) -}) +const server = new ApolloServer({ gateway }) ``` - - - - -If you are using [Express-GraphQL](https://github.com/graphql/express-graphql), here's how you do it: + + +If you are using [GraphQL HTTP](https://github.com/graphql/graphql-http), here's how you do it: ```ts -import express from 'express' -import graphqlHTTP from 'express-graphql' -import { application } from './application' - -const execute = application.createExecution() -const schema = application.schema - -const server = express() - -server.use( - '/', - graphqlHTTP({ - schema, - customExecuteFn: execute, - graphiql: true - }) -) - -server.listen(4000, () => { - console.log(`🚀 Server ready at http://localhost:4000/`) +import http from 'http'; +import { createHandler } from 'graphql-http/lib/use/http'; +import { application } from './application'; + +// Create the GraphQL over HTTP Node request handler +const handler = createHandler({ + schema: application.schema, + execute: application.createExecution(), }) -``` - +// Create a HTTP server using the listener on `/graphql` +const server = http.createServer((req, res) => { + if (req.url.startsWith('/graphql')) { + handler(req, res); + } else { + res.writeHead(404).end(); + } +}); - +server.listen(4000); +console.log('Listening to port 4000'); +``` + + If you are using [GraphQL-Helix](https://github.com/contrawork/graphql-helix), here's how you do it: diff --git a/yarn.lock b/yarn.lock index 776370b043..61b80651ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -177,19 +177,20 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@apollo/cache-control-types@^1.0.2": +"@apollo/cache-control-types@^1.0.2", "@apollo/cache-control-types@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@apollo/cache-control-types/-/cache-control-types-1.0.3.tgz#5da62cf64c3b4419dabfef4536b57a40c8ff0b47" integrity sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g== -"@apollo/federation@0.38.1": - version "0.38.1" - resolved "https://registry.yarnpkg.com/@apollo/federation/-/federation-0.38.1.tgz#0b8a9b4cbf5ebfa3106c20c47ec1f33cf92102a0" - integrity sha512-miifyAEsFgiYKeM3lUHFH6+vKa2vm9dXKSyWVpX6oeJiPblFLe2/iByN3psZQO2sRdVqO1OKYrGXdgKc74XDKw== +"@apollo/federation-internals@2.5.5": + version "2.5.5" + resolved "https://registry.yarnpkg.com/@apollo/federation-internals/-/federation-internals-2.5.5.tgz#4e70e602d87bdaceacdb2de75a85463988063b58" + integrity sha512-6Ywx10Jweuoq9p913HwtIUuJt+uI+hAw5g/Tv/yIA04FNwdPETkLe6Jbz7mnXdGV0b30YcPME2NnKnIu7s/5AA== dependencies: - "@apollo/subgraph" "^0.6.1" - apollo-server-types "^3.0.2" - lodash.xorby "^4.7.0" + "@types/uuid" "^9.0.0" + chalk "^4.1.0" + js-levenshtein "^1.1.6" + uuid "^9.0.0" "@apollo/protobufjs@1.2.6": version "1.2.6" @@ -228,25 +229,91 @@ "@types/long" "^4.0.0" long "^4.0.0" -"@apollo/subgraph@^0.6.1": - version "0.6.1" - resolved "https://registry.yarnpkg.com/@apollo/subgraph/-/subgraph-0.6.1.tgz#18f496f496ecf42d0eb372ab1d2d457d30e5a76e" - integrity sha512-w/6FoubSxuzXSx8uvLE1wEuHZVHRXFyfHPKdM76wX5U/xw82zlUKseVO7wTuVODTcnUzEA30udYeCApUoC3/Xw== +"@apollo/server-gateway-interface@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@apollo/server-gateway-interface/-/server-gateway-interface-1.1.1.tgz#a79632aa921edefcd532589943f6b97c96fa4d3c" + integrity sha512-pGwCl/po6+rxRmDMFgozKQo2pbsSwE91TpsDBAOgf74CRDPXHHtM88wbwjab0wMMZh95QfR45GGyDIdhY24bkQ== + dependencies: + "@apollo/usage-reporting-protobuf" "^4.1.1" + "@apollo/utils.fetcher" "^2.0.0" + "@apollo/utils.keyvaluecache" "^2.1.0" + "@apollo/utils.logger" "^2.0.0" + +"@apollo/server@4.9.4": + version "4.9.4" + resolved "https://registry.yarnpkg.com/@apollo/server/-/server-4.9.4.tgz#fde57e984beef1b2962354a492d3bca072c1067c" + integrity sha512-lopNDM3sZerTcYH/P85QX5HqSNV4HoVbtX3zOrf0ak7eplhPDiGVyF0jQWRbL64znG6KXW+nMuLDTyFTMQnvgA== + 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.0" + "@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" + "@josephg/resolvable" "^1.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" + body-parser "^1.20.0" + cors "^2.8.5" + express "^4.17.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" + +"@apollo/subgraph@2.5.5": + version "2.5.5" + resolved "https://registry.yarnpkg.com/@apollo/subgraph/-/subgraph-2.5.5.tgz#b7bb0363c0eafacd052a8453d9e0877d78a7977b" + integrity sha512-r1r0qMzR6gHK6EoKFpIwcSNID+A78zbqLmCynMV+GYnWt3BvyydtPaw4DgQFo+oMSnEBvk4nI7P3v+xZg4FdSQ== dependencies: "@apollo/cache-control-types" "^1.0.2" + "@apollo/federation-internals" "2.5.5" -"@apollo/usage-reporting-protobuf@^4.0.0": +"@apollo/usage-reporting-protobuf@^4.0.0", "@apollo/usage-reporting-protobuf@^4.1.0", "@apollo/usage-reporting-protobuf@^4.1.1": version "4.1.1" resolved "https://registry.yarnpkg.com/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz#407c3d18c7fbed7a264f3b9a3812620b93499de1" integrity sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA== dependencies: "@apollo/protobufjs" "1.2.7" +"@apollo/utils.createhash@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.createhash/-/utils.createhash-2.0.1.tgz#9d982a166833ce08265ff70f8ef781d65109bdaa" + integrity sha512-fQO4/ZOP8LcXWvMNhKiee+2KuKyqIcfHrICA+M4lj/h/Lh1H10ICcUtk6N/chnEo5HXu0yejg64wshdaiFitJg== + dependencies: + "@apollo/utils.isnodelike" "^2.0.1" + sha.js "^2.4.11" + "@apollo/utils.dropunuseddefinitions@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-1.1.0.tgz#02b04006442eaf037f4c4624146b12775d70d929" integrity sha512-jU1XjMr6ec9pPoL+BFWzEPW7VHHulVdGKMkPAMiCigpVIT11VmCbnij0bWob8uS3ODJ65tZLYKAh/55vLw2rbg== +"@apollo/utils.dropunuseddefinitions@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-2.0.1.tgz#916cd912cbd88769d3b0eab2d24f4674eeda8124" + integrity sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA== + +"@apollo/utils.fetcher@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.fetcher/-/utils.fetcher-2.0.1.tgz#2f6e3edc8ce79fbe916110d9baaddad7e13d955f" + integrity sha512-jvvon885hEyWXd4H6zpWeN3tl88QcWnHp5gWF5OPF34uhvoR+DFqcNxs9vrRaBBSY3qda3Qe0bdud7tz2zGx1A== + +"@apollo/utils.isnodelike@^2.0.0", "@apollo/utils.isnodelike@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.isnodelike/-/utils.isnodelike-2.0.1.tgz#08a7e50f08d2031122efa25af089d1c6ee609f31" + integrity sha512-w41XyepR+jBEuVpoRM715N2ZD0xMD413UiJx8w5xnAZD2ZkSJnMJBoIzauK83kJpSgNuR6ywbV29jG9NmxjK0Q== + "@apollo/utils.keyvaluecache@^1.0.1": version "1.0.2" resolved "https://registry.yarnpkg.com/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz#2bfe358c4d82f3a0950518451996758c52613f57" @@ -255,21 +322,44 @@ "@apollo/utils.logger" "^1.0.0" lru-cache "7.10.1 - 7.13.1" +"@apollo/utils.keyvaluecache@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-2.1.1.tgz#f3f79a2f00520c6ab7a77a680a4e1fec4d19e1a6" + integrity sha512-qVo5PvUUMD8oB9oYvq4ViCjYAMWnZ5zZwEjNF37L2m1u528x5mueMlU+Cr1UinupCgdB78g+egA1G98rbJ03Vw== + dependencies: + "@apollo/utils.logger" "^2.0.1" + lru-cache "^7.14.1" + "@apollo/utils.logger@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@apollo/utils.logger/-/utils.logger-1.0.1.tgz#aea0d1bb7ceb237f506c6bbf38f10a555b99a695" integrity sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA== +"@apollo/utils.logger@^2.0.0", "@apollo/utils.logger@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.logger/-/utils.logger-2.0.1.tgz#74faeb97d7ad9f22282dfb465bcb2e6873b8a625" + integrity sha512-YuplwLHaHf1oviidB7MxnCXAdHp3IqYV8n0momZ3JfLniae92eYqMIx+j5qJFX6WKJPs6q7bczmV4lXIsTu5Pg== + "@apollo/utils.printwithreducedwhitespace@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-1.1.0.tgz#c466299a4766eef8577a2a64c8f27712e8bd7e30" integrity sha512-GfFSkAv3n1toDZ4V6u2d7L4xMwLA+lv+6hqXicMN9KELSJ9yy9RzuEXaX73c/Ry+GzRsBy/fdSUGayGqdHfT2Q== +"@apollo/utils.printwithreducedwhitespace@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-2.0.1.tgz#f4fadea0ae849af2c19c339cc5420d1ddfaa905e" + integrity sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg== + "@apollo/utils.removealiases@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@apollo/utils.removealiases/-/utils.removealiases-1.0.0.tgz#75f6d83098af1fcae2d3beb4f515ad4a8452a8c1" integrity sha512-6cM8sEOJW2LaGjL/0vHV0GtRaSekrPQR4DiywaApQlL9EdROASZU5PsQibe2MWeZCOhNrPRuHh4wDMwPsWTn8A== +"@apollo/utils.removealiases@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.removealiases/-/utils.removealiases-2.0.1.tgz#2873c93d72d086c60fc0d77e23d0f75e66a2598f" + integrity sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA== + "@apollo/utils.sortast@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@apollo/utils.sortast/-/utils.sortast-1.1.0.tgz#93218c7008daf3e2a0725196085a33f5aab5ad07" @@ -277,11 +367,23 @@ dependencies: lodash.sortby "^4.7.0" +"@apollo/utils.sortast@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.sortast/-/utils.sortast-2.0.1.tgz#58c90bb8bd24726346b61fa51ba7fcf06e922ef7" + integrity sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw== + dependencies: + lodash.sortby "^4.7.0" + "@apollo/utils.stripsensitiveliterals@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-1.2.0.tgz#4920651f36beee8e260e12031a0c5863ad0c7b28" integrity sha512-E41rDUzkz/cdikM5147d8nfCFVKovXxKBcjvLEQ7bjZm/cg9zEcXvS6vFY8ugTubI3fn6zoqo0CyU8zT+BGP9w== +"@apollo/utils.stripsensitiveliterals@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-2.0.1.tgz#2f3350483be376a98229f90185eaf19888323132" + integrity sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA== + "@apollo/utils.usagereporting@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@apollo/utils.usagereporting/-/utils.usagereporting-1.0.1.tgz#3c70b49e554771659576fe35381c7a4b321d27fd" @@ -294,6 +396,23 @@ "@apollo/utils.sortast" "^1.1.0" "@apollo/utils.stripsensitiveliterals" "^1.2.0" +"@apollo/utils.usagereporting@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@apollo/utils.usagereporting/-/utils.usagereporting-2.1.0.tgz#11bca6a61fcbc6e6d812004503b38916e74313f4" + integrity sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ== + dependencies: + "@apollo/usage-reporting-protobuf" "^4.1.0" + "@apollo/utils.dropunuseddefinitions" "^2.0.1" + "@apollo/utils.printwithreducedwhitespace" "^2.0.1" + "@apollo/utils.removealiases" "2.0.1" + "@apollo/utils.sortast" "^2.0.1" + "@apollo/utils.stripsensitiveliterals" "^2.0.1" + +"@apollo/utils.withrequired@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@apollo/utils.withrequired/-/utils.withrequired-2.0.1.tgz#e72bc512582a6f26af150439f7eb7473b46ba874" + integrity sha512-YBDiuAX9i1lLc6GeTy1m7DGLFn/gMnvXqlalOIMjM7DeOgIacEjjfwPqb0M1CQ2v11HhR15d1NmxJoRCfrNqcA== + "@apollographql/apollo-tools@^0.5.3": version "0.5.4" resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.5.4.tgz#cb3998c6cf12e494b90c733f44dd9935e2d8196c" @@ -1537,12 +1656,12 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@envelop/core@^3.0.4": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@envelop/core/-/core-3.0.6.tgz#e55c3564d05d648b0356a1c465aa90b0c51f485d" - integrity sha512-06t1xCPXq6QFN7W1JUEf68aCwYN0OUDNAIoJe7bAqhaoa2vn7NCcuX1VHkJ/OWpmElUgCsRO6RiBbIru1in0Ig== +"@envelop/core@^4.0.0": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@envelop/core/-/core-4.0.3.tgz#6bc3e1ed3b31aa41d81106eb5071a9b8eec188d0" + integrity sha512-O0Vz8E0TObT6ijAob8jYFVJavcGywKThM3UAsxUIBBVPYZTMiqI9lo2gmAnbMUnrDcAYkUTZEW9FDYPRdF5l6g== dependencies: - "@envelop/types" "3.0.2" + "@envelop/types" "4.0.1" tslib "^2.5.0" "@envelop/graphql-modules@5.0.3": @@ -1552,20 +1671,11 @@ dependencies: tslib "^2.5.0" -"@envelop/types@3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@envelop/types/-/types-3.0.2.tgz#a4b29375b7fcee39bb5830f87f66bbc815cf305e" - integrity sha512-pOFea9ha0EkURWxJ/35axoH9fDGP5S2cUu/5Mmo9pb8zUf+TaEot8vB670XXihFEn/92759BMjLJNWBKmNhyng== - dependencies: - tslib "^2.5.0" - -"@envelop/validation-cache@^5.1.2": - version "5.1.3" - resolved "https://registry.yarnpkg.com/@envelop/validation-cache/-/validation-cache-5.1.3.tgz#8348453183af348147e2b690a431b6ca81d2a6bc" - integrity sha512-MkzcScQHJJQ/9YCAPdWShEi3xZv4F4neTs+NszzSrZOdlU8z/THuRt7gZ0sO0y2be+sx+SKjHQP8Gq3VXXcTTg== +"@envelop/types@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@envelop/types/-/types-4.0.1.tgz#145690d8266a003cdb06dd58fa1236e3c80050a9" + integrity sha512-ULo27/doEsP7uUhm2iTnElx13qTO6I5FKvmLoX41cpfuw8x6e0NUFknoqhEsLzAbgz8xVS5mjwcxGCXh4lDYzg== dependencies: - hash-it "^6.0.0" - lru-cache "^6.0.0" tslib "^2.5.0" "@esbuild/linux-loong64@0.14.54": @@ -1617,39 +1727,6 @@ dependencies: giscus "^1.3.0" -"@graphql-tools/batch-execute@^9.0.1": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-9.0.2.tgz#5ac3257501e7941fad40661bb5e1110d6312f58b" - integrity sha512-Y2uwdZI6ZnatopD/SYfZ1eGuQFI7OU2KGZ2/B/7G9ISmgMl5K+ZZWz/PfIEXeiHirIDhyk54s4uka5rj2xwKqQ== - dependencies: - "@graphql-tools/utils" "^10.0.5" - dataloader "^2.2.2" - tslib "^2.4.0" - value-or-promise "^1.0.12" - -"@graphql-tools/delegate@^10.0.3": - version "10.0.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-10.0.3.tgz#2d0e133da94ca92c24e0c7360414e5592321cf2d" - integrity sha512-Jor9oazZ07zuWkykD3OOhT/2XD74Zm6Ar0ENZMk75MDD51wB2UWUIMljtHxbJhV5A6UBC2v8x6iY0xdCGiIlyw== - dependencies: - "@graphql-tools/batch-execute" "^9.0.1" - "@graphql-tools/executor" "^1.0.0" - "@graphql-tools/schema" "^10.0.0" - "@graphql-tools/utils" "^10.0.5" - dataloader "^2.2.2" - tslib "^2.5.0" - -"@graphql-tools/executor@^0.0.18": - version "0.0.18" - resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-0.0.18.tgz#5b9f881d59484ea55278de3b4743ece8d68bc6e7" - integrity sha512-xZC0C+/npXoSHBB5bsJdwxDLgtl1Gu4fL9J2TPQmXoZC3L2N506KJoppf9LgWdHU/xK04luJrhP6WjhfkIN0pQ== - dependencies: - "@graphql-tools/utils" "^9.2.1" - "@graphql-typed-document-node/core" "3.2.0" - "@repeaterjs/repeater" "3.0.4" - tslib "^2.4.0" - value-or-promise "1.0.12" - "@graphql-tools/executor@^1.0.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-1.2.0.tgz#6c45f4add765769d9820c4c4405b76957ba39c79" @@ -1715,7 +1792,7 @@ tslib "^2.4.0" value-or-promise "1.0.11" -"@graphql-tools/schema@^9.0.18": +"@graphql-tools/schema@^9.0.0", "@graphql-tools/schema@^9.0.18": version "9.0.19" resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-9.0.19.tgz#c4ad373b5e1b8a0cf365163435b7d236ebdd06e7" integrity sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w== @@ -1732,10 +1809,10 @@ dependencies: tslib "^2.4.0" -"@graphql-tools/utils@^10.0.0", "@graphql-tools/utils@^10.0.5": - version "10.0.7" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.0.7.tgz#ed88968b5ce53dabacbdd185df967aaab35f8549" - integrity sha512-KOdeMj6Hd/MENDaqPbws3YJl3wVy0DeYnL7PyUms5Skyf7uzI9INynDwPMhLXfSb0/ph6BXTwMd5zBtWbF8tBQ== +"@graphql-tools/utils@^10.0.0": + version "10.0.6" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.0.6.tgz#8a809d6bc0df27ffe8964696f182af2383b5974b" + integrity sha512-hZMjl/BbX10iagovakgf3IiqArx8TPsotq5pwBld37uIX1JiZoSbgbCIFol7u55bh32o6cfDEiiJgfAD5fbeyQ== dependencies: "@graphql-typed-document-node/core" "^3.1.1" dset "^3.1.2" @@ -1749,54 +1826,35 @@ "@graphql-typed-document-node/core" "^3.1.1" tslib "^2.4.0" -"@graphql-tools/wrap@^10.0.0": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-10.0.1.tgz#9e3d27d2723962c26c4377d5d7ab0d3038bf728c" - integrity sha512-Cw6hVrKGM2OKBXeuAGltgy4tzuqQE0Nt7t/uAqnuokSXZhMHXJUb124Bnvxc2gPZn5chfJSDafDe4Cp8ZAVJgg== - dependencies: - "@graphql-tools/delegate" "^10.0.3" - "@graphql-tools/schema" "^10.0.0" - "@graphql-tools/utils" "^10.0.0" - tslib "^2.4.0" - value-or-promise "^1.0.12" - "@graphql-typed-document-node/core@3.2.0", "@graphql-typed-document-node/core@^3.1.0", "@graphql-typed-document-node/core@^3.1.1", "@graphql-typed-document-node/core@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== -"@graphql-yoga/logger@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@graphql-yoga/logger/-/logger-0.0.1.tgz#48504fa6ecaee487d9df00fd44c28e356635a324" - integrity sha512-6npFz7eZz33mXgSm1waBLMjUNG0D5hTc/p5Hcs1mojkT3KsLpCOFokzTEKboNsBhKevYcaVa/xeA7WBj4UYMLg== - dependencies: - tslib "^2.3.1" - -"@graphql-yoga/node@3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@graphql-yoga/node/-/node-3.9.1.tgz#95f19dc340e0b484b49a3101703378ba483a9238" - integrity sha512-+VIvnVipFo1iDFtayng/AANT1XrdixdScpaMxN/aokGPW3N3NMlpOjClxjQSQhlMlvdCWdtafjbAdstYcyY1sA== +"@graphql-yoga/logger@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@graphql-yoga/logger/-/logger-1.0.0.tgz#0fba12edd8c4b0b9c0f0a74b0d101f1646c3780e" + integrity sha512-JYoxwnPggH2BfO+dWlWZkDeFhyFZqaTRGLvFhy+Pjp2UxitEW6nDrw+pEDw/K9tJwMjIFMmTT9VfTqrnESmBHg== dependencies: - graphql-yoga "3.9.1" - tslib "^2.3.1" + tslib "^2.5.2" -"@graphql-yoga/subscription@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@graphql-yoga/subscription/-/subscription-3.1.0.tgz#4a0bb0b9db2602d02c68f9828603e1e40329140b" - integrity sha512-Vc9lh8KzIHyS3n4jBlCbz7zCjcbtQnOBpsymcRvHhFr2cuH+knmRn0EmzimMQ58jQ8kxoRXXC3KJS3RIxSdPIg== +"@graphql-yoga/subscription@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@graphql-yoga/subscription/-/subscription-4.0.0.tgz#2bf5844ce8aeff46332650ad642218250201dcc5" + integrity sha512-0qsN/BPPZNMoC2CZ8i+P6PgiJyHh1H35aKDt37qARBDaIOKDQuvEOq7+4txUKElcmXi7DYFo109FkhSQoEajrg== dependencies: - "@graphql-yoga/typed-event-target" "^1.0.0" + "@graphql-yoga/typed-event-target" "^2.0.0" "@repeaterjs/repeater" "^3.0.4" - "@whatwg-node/events" "0.0.2" - tslib "^2.3.1" + "@whatwg-node/events" "^0.1.0" + tslib "^2.5.2" -"@graphql-yoga/typed-event-target@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@graphql-yoga/typed-event-target/-/typed-event-target-1.0.0.tgz#dae3c0146f08a4dc30b5b890f8bab706c2b62199" - integrity sha512-Mqni6AEvl3VbpMtKw+TIjc9qS9a8hKhiAjFtqX488yq5oJtj9TkNlFTIacAVS3vnPiswNsmDiQqvwUOcJgi1DA== +"@graphql-yoga/typed-event-target@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@graphql-yoga/typed-event-target/-/typed-event-target-2.0.0.tgz#41809fc8c101c27c61a5427d74e0d0ce824044db" + integrity sha512-oA/VGxGmaSDym1glOHrltw43qZsFwLLjBwvh57B79UKX/vo3+UQcRgOyE44c5RP7DCYjkrC2tuArZmb6jCzysw== dependencies: "@repeaterjs/repeater" "^3.0.4" - tslib "^2.3.1" + tslib "^2.5.2" "@headlessui/react@^1.7.17": version "1.7.17" @@ -2309,33 +2367,6 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@peculiar/asn1-schema@^2.3.6": - version "2.3.6" - resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.3.6.tgz#3dd3c2ade7f702a9a94dfb395c192f5fa5d6b922" - integrity sha512-izNRxPoaeJeg/AyH8hER6s+H7p4itk+03QCa4sbxI3lNdseQYCuxzgsuNK8bTXChtLTjpJz6NmXKA73qLa3rCA== - dependencies: - asn1js "^3.0.5" - pvtsutils "^1.3.2" - tslib "^2.4.0" - -"@peculiar/json-schema@^1.1.12": - version "1.1.12" - resolved "https://registry.yarnpkg.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz#fe61e85259e3b5ba5ad566cb62ca75b3d3cd5339" - integrity sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w== - dependencies: - tslib "^2.0.0" - -"@peculiar/webcrypto@^1.4.0": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.4.3.tgz#078b3e8f598e847b78683dc3ba65feb5029b93a7" - integrity sha512-VtaY4spKTdN5LjJ04im/d/joXuvLbQdgy5Z4DXF4MFZhQ+MTrejbNMkfZBp1Bs3O5+bFqnJgyGdPuZQflvIa5A== - dependencies: - "@peculiar/asn1-schema" "^2.3.6" - "@peculiar/json-schema" "^1.1.12" - pvtsutils "^1.3.2" - tslib "^2.5.0" - webcrypto-core "^1.7.7" - "@polka/url@^1.0.0-next.20": version "1.0.0-next.23" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.23.tgz#498e41218ab3b6a1419c735e5c6ae2c5ed609b6c" @@ -2549,7 +2580,7 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.3" -"@repeaterjs/repeater@3.0.4", "@repeaterjs/repeater@^3.0.4": +"@repeaterjs/repeater@^3.0.4": version "3.0.4" resolved "https://registry.yarnpkg.com/@repeaterjs/repeater/-/repeater-3.0.4.tgz#a04d63f4d1bf5540a41b01a921c9a7fddc3bd1ca" integrity sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA== @@ -2714,9 +2745,9 @@ integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@types/accepts@^1.3.5": - version "1.3.5" - resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.5.tgz#c34bec115cfc746e04fe5a059df4ce7e7b391575" - integrity sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ== + version "1.3.6" + resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.6.tgz#5e33830c8ed7b6025976738c88540df2e85b6d91" + integrity sha512-6+qlUg57yfE9OO63wnsJXLeq9cG3gSHBBIxNMOjNrbDRlDnm/NaR7RctfYcVCPq+j7d+MwOxqVEludH5+FKrlg== dependencies: "@types/node" "*" @@ -2795,6 +2826,13 @@ resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== +"@types/cors@2.8.14": + version "2.8.14" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.14.tgz#94eeb1c95eda6a8ab54870a3bf88854512f43a92" + integrity sha512-RXHUvNWYICtbP6s18PnOCaqToK8y14DnLd75c6HfyKf228dxy7pHNOQkxPtvXKp/hINFMDjbYzsj63nnpPMSRQ== + dependencies: + "@types/node" "*" + "@types/d3-scale-chromatic@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz#103124777e8cdec85b20b51fd3397c682ee1e954" @@ -2845,7 +2883,7 @@ "@types/qs" "*" "@types/range-parser" "*" -"@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.33": +"@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.30": version "4.17.37" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.37.tgz#7e4b7b59da9142138a2aaa7621f5abedce8c7320" integrity sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg== @@ -2855,6 +2893,16 @@ "@types/range-parser" "*" "@types/send" "*" +"@types/express-serve-static-core@^4.17.33": + version "4.17.36" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.36.tgz#baa9022119bdc05a4adfe740ffc97b5f9360e545" + integrity sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + "@types/send" "*" + "@types/express@4.17.14": version "4.17.14" resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.14.tgz#143ea0557249bc1b3b54f15db4c81c3d4eb3569c" @@ -2875,6 +2923,16 @@ "@types/qs" "*" "@types/serve-static" "*" +"@types/express@^4.17.13": + version "4.17.18" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.18.tgz#efabf5c4495c1880df1bdffee604b143b29c4a95" + integrity sha512-Sxv8BSLLgsBYmcnGdGjjEjqET2U+AKAdCRODmMiq02FgjwuV75Ut85DRpvFjyw/Mk0vgUOliGRU0UUmuuZHByQ== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.33" + "@types/qs" "*" + "@types/serve-static" "*" + "@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.3": version "4.1.7" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.7.tgz#30443a2e64fd51113bc3e2ba0914d47109695e2a" @@ -2996,7 +3054,20 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.32.tgz#f6cd08939ae3ad886fcc92ef7f0109dacddf61ab" integrity sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g== -"@types/node@*", "@types/node@18.18.7": +"@types/node-fetch@^2.6.1": + version "2.6.6" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.6.tgz#b72f3f4bc0c0afee1c0bc9cff68e041d01e3e779" + integrity sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw== + dependencies: + "@types/node" "*" + form-data "^4.0.0" + +"@types/node@*": + version "18.17.19" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.19.tgz#80c9b8a89d3648d9e6098f4a7184e03833fee3c5" + integrity sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q== + +"@types/node@18.18.7": version "18.18.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.7.tgz#bb3a7068dc4ba421b6968f2a259298b3a4e129e8" integrity sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ== @@ -3120,6 +3191,11 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.0.tgz#988ae8af1e5239e89f9fbb1ade4c935f4eeedf9a" integrity sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w== +"@types/uuid@^9.0.0": + version "9.0.5" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.5.tgz#25a71eb73eba95ac0e559ff3dd018fc08294acf6" + integrity sha512-xfHdwa1FMJ082prjSJpoEI57GZITiQz10r3vEJCHa2khEFQjKy91aWKz6+zybzssCvXUwE1LQWgWVwZ4nYUvHQ== + "@types/yargs-parser@*": version "21.0.1" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.1.tgz#07773d7160494d56aa882d7531aac7319ea67c3b" @@ -3234,44 +3310,36 @@ resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.31.1.tgz#9346c7e59326f5eeac75c0286e47df94c2d6d8f7" integrity sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA== -"@whatwg-node/events@0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.0.2.tgz#7b7107268d2982fc7b7aff5ee6803c64018f84dd" - integrity sha512-WKj/lI4QjnLuPrim0cfO7i+HsDSXHxNv1y0CrJhdntuO3hxWZmnXCwNDnwOvry11OjRin6cgWNF+j/9Pn8TN4w== - -"@whatwg-node/events@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.0.3.tgz#13a65dd4f5893f55280f766e29ae48074927acad" - integrity sha512-IqnKIDWfXBJkvy/k6tzskWTc2NK3LcqHlb+KHGCrjOCH4jfQckRX0NAiIcC/vIqQkzLYw2r2CTSwAxcrtcD6lA== +"@whatwg-node/events@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.1.1.tgz#0ca718508249419587e130da26d40e29d99b5356" + integrity sha512-AyQEn5hIPV7Ze+xFoXVU3QTHXVbWPrzaOkxtENMPMuNL6VVHrp4hHfDt9nrQpjO7BgvuM95dMtkycX5M/DZR3w== -"@whatwg-node/fetch@^0.8.3", "@whatwg-node/fetch@^0.8.4": - version "0.8.8" - resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.8.8.tgz#48c6ad0c6b7951a73e812f09dd22d75e9fa18cae" - integrity sha512-CdcjGC2vdKhc13KKxgsc6/616BQ7ooDIgPeTuAiE8qfCnS0mGzcfCOoZXypQSz73nxI+GWc7ZReIAVhxoE1KCg== +"@whatwg-node/fetch@^0.9.10", "@whatwg-node/fetch@^0.9.7": + version "0.9.13" + resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.9.13.tgz#1d084cd546b9cd425ae89cbb1252a3e47a9a2e1c" + integrity sha512-PPtMwhjtS96XROnSpowCQM85gCUG2m7AXZFw0PZlGbhzx2GK7f2iOXilfgIJ0uSlCuuGbOIzfouISkA7C4FJOw== dependencies: - "@peculiar/webcrypto" "^1.4.0" - "@whatwg-node/node-fetch" "^0.3.6" - busboy "^1.6.0" - urlpattern-polyfill "^8.0.0" - web-streams-polyfill "^3.2.1" + "@whatwg-node/node-fetch" "^0.4.17" + urlpattern-polyfill "^9.0.0" -"@whatwg-node/node-fetch@^0.3.6": - version "0.3.6" - resolved "https://registry.yarnpkg.com/@whatwg-node/node-fetch/-/node-fetch-0.3.6.tgz#e28816955f359916e2d830b68a64493124faa6d0" - integrity sha512-w9wKgDO4C95qnXZRwZTfCmLWqyRnooGjcIwG0wADWjw9/HN0p7dtvtgSvItZtUyNteEvgTrd8QojNEqV6DAGTA== +"@whatwg-node/node-fetch@^0.4.17": + version "0.4.19" + resolved "https://registry.yarnpkg.com/@whatwg-node/node-fetch/-/node-fetch-0.4.19.tgz#29c72ff65a8e450949238612ff17a3d3717736d3" + integrity sha512-AW7/m2AuweAoSXmESrYQr/KBafueScNbn2iNO0u6xFr2JZdPmYsSm5yvAXYk6yDLv+eDmSSKrf7JnFZ0CsJIdA== dependencies: - "@whatwg-node/events" "^0.0.3" + "@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@^0.7.3": - version "0.7.7" - resolved "https://registry.yarnpkg.com/@whatwg-node/server/-/server-0.7.7.tgz#daaae73999cf8ea4d4f7e617276dcb8e84a6e49e" - integrity sha512-aHURgNDFm/48WVV3vhTMfnEKCYwYgdaRdRhZsQZx4UVFjGGkGay7Ys0+AYu9QT/jpoImv2oONkstoTMUprDofg== +"@whatwg-node/server@^0.9.1": + version "0.9.14" + resolved "https://registry.yarnpkg.com/@whatwg-node/server/-/server-0.9.14.tgz#54c47b50c370e46fabdcbbed06be3d84686b8a91" + integrity sha512-I8TT0NoCP+xThLBuGlU6dgq5wpExkphNMo2geZwQW0vAmEPtc3MNMZMIYqg5GyNmpv5Nf7fnxb8tVOIHbDvuDA== dependencies: - "@whatwg-node/fetch" "^0.8.3" + "@whatwg-node/fetch" "^0.9.10" tslib "^2.3.1" "@yarnpkg/lockfile@^1.1.0": @@ -3284,7 +3352,7 @@ abab@^2.0.3, abab@^2.0.5: resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -accepts@^1.3.5, accepts@^1.3.7, accepts@~1.3.8: +accepts@^1.3.5, accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -3575,7 +3643,7 @@ apollo-server-plugin-base@^3.7.2: dependencies: apollo-server-types "^3.8.0" -apollo-server-types@^3.0.2, apollo-server-types@^3.8.0: +apollo-server-types@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-3.8.0.tgz#d976b6967878681f715fe2b9e4dad9ba86b1346f" integrity sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A== @@ -3739,15 +3807,6 @@ artillery@1.7.9: uuid "^2.0.3" ws "^5.1.1" -asn1js@^3.0.1, asn1js@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-3.0.5.tgz#5ea36820443dbefb51cc7f88a2ebb5b462114f38" - integrity sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ== - dependencies: - pvtsutils "^1.3.2" - pvutils "^1.1.3" - tslib "^2.4.0" - astring@^1.8.0: version "1.8.6" resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.6.tgz#2c9c157cf1739d67561c56ba896e6948f6b93731" @@ -4024,7 +4083,7 @@ bob-the-bundler@1.7.3: tsup "^5.11.6" yargs "15.3.1" -body-parser@1.20.1, body-parser@^1.19.0: +body-parser@1.20.1: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== @@ -4042,6 +4101,24 @@ body-parser@1.20.1, body-parser@^1.19.0: type-is "~1.6.18" unpipe "1.0.0" +body-parser@^1.19.0, body-parser@^1.20.0: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + boolbase@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" @@ -4615,7 +4692,7 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@^1.0.4, content-type@~1.0.4: +content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== @@ -4647,7 +4724,7 @@ core-js-compat@^3.31.0, core-js-compat@^3.33.1: dependencies: browserslist "^4.22.1" -cors@^2.8.5: +cors@2.8.5, cors@^2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== @@ -5187,7 +5264,7 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -dataloader@2.2.2, dataloader@^2.2.2: +dataloader@2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.2.2.tgz#216dc509b5abe39d43a9b9d97e6e5e473dfbe3e0" integrity sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g== @@ -5341,11 +5418,6 @@ depd@2.0.0: resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== - dependency-graph@0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" @@ -6133,16 +6205,6 @@ expect@^27.5.1: jest-matcher-utils "^27.5.1" jest-message-util "^27.5.1" -express-graphql@0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.12.0.tgz#58deabc309909ca2c9fe2f83f5fbe94429aa23df" - integrity sha512-DwYaJQy0amdy3pgNtiTDuGGM2BLdj+YO2SgbKoLliCfuHv3VVTt7vNG/ZqK2hRYjtYHE2t2KB705EU94mE64zg== - dependencies: - accepts "^1.3.7" - content-type "^1.0.4" - http-errors "1.8.0" - raw-body "^2.4.1" - express@4.18.2, express@^4.17.1: version "4.18.2" resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" @@ -6424,6 +6486,15 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + format@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" @@ -6723,6 +6794,11 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== +graphql-http@1.22.0: + version "1.22.0" + resolved "https://registry.yarnpkg.com/graphql-http/-/graphql-http-1.22.0.tgz#967bad279747ba5e1c9dd85b644c6b4f3dfa88f2" + integrity sha512-9RBUlGJWBFqz9LwfpmAbjJL/8j/HCNkZwPBU5+Bfmwez+1Ay43DocMNQYpIWsWqH0Ftv6PTNAh2aRnnMCBJgLw== + graphql-jit@0.8.4: version "0.8.4" resolved "https://registry.yarnpkg.com/graphql-jit/-/graphql-jit-0.8.4.tgz#53c2e43b90ec98ea0942f4062516de910fbff709" @@ -6754,23 +6830,22 @@ graphql-ws@5.14.2: resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.2.tgz#7db6f6138717a544d9480f0213f65f2841ed1c52" integrity sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w== -graphql-yoga@3.9.1: - version "3.9.1" - resolved "https://registry.yarnpkg.com/graphql-yoga/-/graphql-yoga-3.9.1.tgz#e35c959fac5c1d81e2244a0665b5da6357d4e637" - integrity sha512-BB6EkN64VBTXWmf9Kym2OsVZFzBC0mAsQNo9eNB5xIr3t+x7qepQ34xW5A353NWol3Js3xpzxwIKFVF6l9VsPg== +graphql-yoga@4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/graphql-yoga/-/graphql-yoga-4.0.5.tgz#7545f430d2e83998d22427b63fd511976dba47c4" + integrity sha512-vIbJU9QX5RP4PoxbMCHcfOlt/3EsC/0uLdAOlKaiUvlwJDTFCaIHo2X10vL4i/27Gw8g90ECIwm2YbmeLDwcqg== dependencies: - "@envelop/core" "^3.0.4" - "@envelop/validation-cache" "^5.1.2" - "@graphql-tools/executor" "^0.0.18" - "@graphql-tools/schema" "^9.0.18" - "@graphql-tools/utils" "^9.2.1" - "@graphql-yoga/logger" "^0.0.1" - "@graphql-yoga/subscription" "^3.1.0" - "@whatwg-node/fetch" "^0.8.4" - "@whatwg-node/server" "^0.7.3" + "@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 "^7.14.1" - tslib "^2.3.1" + lru-cache "^10.0.0" + tslib "^2.5.2" graphql@16.8.1: version "16.8.1" @@ -6867,11 +6942,6 @@ has@^1.0.3: resolved "https://registry.yarnpkg.com/has/-/has-1.0.4.tgz#2eb2860e000011dae4f1406a86fe80e530fb2ec6" integrity sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ== -hash-it@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/hash-it/-/hash-it-6.0.0.tgz#188df5a8ca2f8e036690e35f2ef88bd9417ff334" - integrity sha512-KHzmSFx1KwyMPw0kXeeUD752q/Kfbzhy6dAZrjXV9kAIXGqzGvv8vhkUqj+2MGZldTo0IBpw6v7iWE7uxsvH0w== - hash-obj@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/hash-obj/-/hash-obj-4.0.0.tgz#3fafeb0b5f17994441dbe04efbdee82e26b74c8c" @@ -7118,17 +7188,6 @@ http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== -http-errors@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" - integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - http-errors@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" @@ -8170,6 +8229,11 @@ joycon@^3.0.1: resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== +js-levenshtein@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" + integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -8554,11 +8618,6 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash.xorby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.xorby/-/lodash.xorby-4.7.0.tgz#9c19a6f9f063a6eb53dd03c1b6871799801463d7" - integrity sha512-gYiD6nvuQy0AEkMoUju+t4f4Rn18fjsLB/7x7YZFqtFT9kmegRLrj/uGEQVyVDy7otTmSrIMXNOk2wwuLcfHCQ== - lodash@^4.17.11, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -8626,6 +8685,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.13.1.tgz#267a81fbd0881327c46a81c5922606a2cfe336c4" integrity sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ== +lru-cache@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a" + integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -8648,7 +8712,7 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^7.14.1: +lru-cache@^7.10.1, lru-cache@^7.14.1: version "7.18.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== @@ -9885,7 +9949,7 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -negotiator@0.6.3: +negotiator@0.6.3, negotiator@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== @@ -9996,7 +10060,7 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-abort-controller@^3.0.1: +node-abort-controller@^3.0.1, node-abort-controller@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.1.1.tgz#a94377e964a9a37ac3976d848cb5c765833b8548" integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ== @@ -10879,18 +10943,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== -pvtsutils@^1.3.2: - version "1.3.5" - resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.3.5.tgz#b8705b437b7b134cd7fd858f025a23456f1ce910" - integrity sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA== - dependencies: - tslib "^2.6.1" - -pvutils@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.1.3.tgz#f35fc1d27e7cd3dfbd39c0826d173e806a03f5a3" - integrity sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ== - qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" @@ -10928,7 +10980,7 @@ range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1, raw-body@^2.4.1: +raw-body@2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== @@ -10938,6 +10990,16 @@ raw-body@2.5.1, raw-body@^2.4.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + rc@^1.0.1, rc@^1.1.6: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -11818,11 +11880,6 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.5.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== - stream-transform@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/stream-transform/-/stream-transform-2.1.3.tgz#a1c3ecd72ddbf500aa8d342b0b9df38f5aa598e3" @@ -12224,11 +12281,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - toidentifier@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" @@ -12359,7 +12411,7 @@ tslib@1.11.1, tslib@^1.11.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.1: +tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.5.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -12807,10 +12859,10 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" -urlpattern-polyfill@^8.0.0: - version "8.0.2" - resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz#99f096e35eff8bf4b5a2aa7d58a1523d6ebc7ce5" - integrity sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ== +urlpattern-polyfill@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz#bc7e386bb12fd7898b58d1509df21d3c29ab3460" + integrity sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g== util-deprecate@^1.0.2: version "1.0.2" @@ -12874,7 +12926,7 @@ value-or-promise@1.0.11: resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140" integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg== -value-or-promise@1.0.12, value-or-promise@^1.0.12: +value-or-promise@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.12.tgz#0e5abfeec70148c78460a849f6b003ea7986f15c" integrity sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q== @@ -12968,27 +13020,11 @@ web-namespaces@^2.0.0: resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== -web-streams-polyfill@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - web-worker@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/web-worker/-/web-worker-1.2.0.tgz#5d85a04a7fbc1e7db58f66595d7a3ac7c9c180da" integrity sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA== -webcrypto-core@^1.7.7: - version "1.7.7" - resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.7.7.tgz#06f24b3498463e570fed64d7cab149e5437b162c" - integrity sha512-7FjigXNsBfopEj+5DV2nhNpfic2vumtjjgPmeDKk45z+MJwXKKfhPB7118Pfzrmh4jqOMST6Ch37iPAHoImg5g== - dependencies: - "@peculiar/asn1-schema" "^2.3.6" - "@peculiar/json-schema" "^1.1.12" - asn1js "^3.0.1" - pvtsutils "^1.3.2" - tslib "^2.4.0" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From 19bec3a6a28143117c734b7cec366e2a230545f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Oct 2023 15:28:23 +0000 Subject: [PATCH 2/5] chore(dependencies): updated changesets for modified dependencies --- .changeset/graphql-modules-2444-dependencies.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/graphql-modules-2444-dependencies.md diff --git a/.changeset/graphql-modules-2444-dependencies.md b/.changeset/graphql-modules-2444-dependencies.md new file mode 100644 index 0000000000..248878bb9d --- /dev/null +++ b/.changeset/graphql-modules-2444-dependencies.md @@ -0,0 +1,5 @@ +--- +'graphql-modules': patch +--- +dependencies updates: + - Removed dependency [`@graphql-tools/wrap@^10.0.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/10.0.0) (from `dependencies`) From a92e7c335ca30cb5818c586bc3292e228272dd09 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Tue, 10 Oct 2023 23:26:09 +0300 Subject: [PATCH 3/5] Update benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c2735c06bb..aa8aa18776 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -8,4 +8,4 @@ jobs: uses: the-guild-org/shared-config/.github/workflows/ci-node-matrix.yml@main with: script: 'yarn build && yarn benchmark:basic' - nodeVersions: '[16,18]' + nodeVersions: '[18,20]' From 1af4b22a7af291756d5c381332483de4e4be70d3 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Wed, 18 Oct 2023 11:34:40 -0500 Subject: [PATCH 4/5] Add Apollo Server test back --- .../tests/di-providers.spec.ts | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/packages/graphql-modules/tests/di-providers.spec.ts b/packages/graphql-modules/tests/di-providers.spec.ts index feb91d2f9e..b77556ba6e 100644 --- a/packages/graphql-modules/tests/di-providers.spec.ts +++ b/packages/graphql-modules/tests/di-providers.spec.ts @@ -12,6 +12,7 @@ import { testkit, } from '../src'; import { ExecutionContext } from '../src/di'; +import { ApolloServer } from '@apollo/server'; const Test = new InjectionToken('test'); @@ -541,6 +542,100 @@ test('Operation scoped provider should be created once per GraphQL Operation', a expect(loadSpy).toHaveBeenCalledWith(1); }); +test('Operation scoped provider should be created once per GraphQL Operation (Apollo Server)', async () => { + const constructorSpy = jest.fn(); + const loadSpy = jest.fn(); + + @Injectable({ + scope: Scope.Operation, + }) + class Dataloader { + constructor(@Inject(CONTEXT) context: GraphQLModulesGlobalContext) { + constructorSpy(context); + } + + load(id: number) { + loadSpy(id); + return { + id, + title: 'Sample Title', + }; + } + } + + const postsModule = createModule({ + id: 'posts', + providers: [Dataloader], + typeDefs: gql` + type Post { + id: Int! + title: String! + } + type Query { + post(id: Int!): Post! + } + `, + resolvers: { + Query: { + post( + _parent: {}, + args: { id: number }, + { injector }: GraphQLModulesModuleContext + ) { + return injector.get(Dataloader).load(args.id); + }, + }, + }, + }); + + const app = createApplication({ + modules: [postsModule], + }); + + const apolloServer = new ApolloServer({ + gateway: app.createApolloGateway(), + }); + + const query = gql` + { + foo: post(id: 1) { + id + title + } + bar: post(id: 1) { + id + title + } + } + `; + + const result = await apolloServer.executeOperation({ + query, + }); + + if (result.body.kind === 'incremental') { + throw new Error('Expected non-incremental response'); + } + + // Should resolve data correctly + expect(result.body.singleResult.errors).toBeUndefined(); + expect(result.body.singleResult.data).toEqual({ + foo: { + id: 1, + title: 'Sample Title', + }, + bar: { + id: 1, + title: 'Sample Title', + }, + }); + + expect(constructorSpy).toHaveBeenCalledTimes(1); + + expect(loadSpy).toHaveBeenCalledTimes(2); + expect(loadSpy).toHaveBeenCalledWith(1); +}); + test('Singleton scoped provider should be created once', async () => { const constructorSpy = jest.fn(); From 0b04b56ee3e6b1bb7583c3dd794b94df5f0b0e1a Mon Sep 17 00:00:00 2001 From: enisdenjo Date: Mon, 6 Nov 2023 14:30:24 +0100 Subject: [PATCH 5/5] trigger