Graphql: [Fastify GraphQL Bug] TypeError: this._apolloServer.installSubscriptionHandlers is not a function

Created on 29 Jul 2021  路  1Comment  路  Source: nestjs/graphql

Bug Report

If I set installSubscriptionHandlers true with apollo-server-fastify
_TypeError: this._apolloServer.installSubscriptionHandlers is not a function_ error were occurred

Input Code

    GraphQLModule.forRootAsync({
      useFactory: async (configService: ConfigService) => {
        const graphqlConfig = configService.get<GraphqlConfig>('graphql');
        return {
          installSubscriptionHandlers: true,
          buildSchemaOptions: {
            numberScalarMode: 'integer',
          },
          sortSchema: graphqlConfig!.sortSchema,
          autoSchemaFile: graphqlConfig!.schemaDestination,
          debug: graphqlConfig!.debug,
          playground: graphqlConfig!.playgroundEnabled,
          plugins: [apolloServerSentryPlugin],
          context: ({ req }) => ({ req }),
        };
      },
      inject: [ConfigService],
    }),

Environment


"@nestjs/common": "^8.0.5",
"@nestjs/config": "^1.0.1",
"@nestjs/core": "^8.0.5",
"@nestjs/graphql": "^8.0.2",
"@nestjs/jwt": "^8.0.0",
"@nestjs/passport": "^8.0.0",
"@nestjs/platform-fastify": "^8.0.5",
"apollo-server-fastify": "^3.0.2",

Most helpful comment

NestJS v8 isn't compatible with Apollo v3. Apollo v3 removed built-in subscriptions support. We're tracking this here https://github.com/nestjs/graphql/pull/1638

For the time being, you should, for example, use the [email protected] version

>All comments

NestJS v8 isn't compatible with Apollo v3. Apollo v3 removed built-in subscriptions support. We're tracking this here https://github.com/nestjs/graphql/pull/1638

For the time being, you should, for example, use the [email protected] version

Was this page helpful?
0 / 5 - 0 ratings