hello everyone, I'm trying to follow the documentation to enable subscriptions using "graphql-ws", problem is i'm getting a type error for the "subscriptions" key in the GraphqlMdule configuration.
I'm also using neo4j Graphql but I'm providing it as a factory, so I don't think it's interfering somehow.
Sorry for the nooby question but I can't find a way around this..
gql.module.ts
import { Module } from '@nestjs/common';
import neo4j from "neo4j-driver";
import { Neo4jGraphQL } from "@neo4j/graphql";
import { typeDefs } from './type-defs';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
export const gqlProviderFactory = async () => {
const { NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD } = process.env;
const driver = neo4j.driver(
NEO4J_URI,
neo4j.auth.basic(NEO4J_USERNAME, NEO4J_PASSWORD)
);
const neoSchema = new Neo4jGraphQL({
typeDefs,
driver
});
const schema = await neoSchema.getSchema();
await neoSchema.assertIndexesAndConstraints({
options: { create: true }
});
return {
playground: true,
schema
};
};
@Module({
imports: [
GraphQLModule.forRootAsync<ApolloDriverConfig>({
driver: ApolloDriver,
subscriptions: {
'graphql-ws': true
}
// useFactory: gqlProviderFactory,
})
]
})
export class GqlModule {
}