Skip to content

how to have multiple graphql module with different pathΒ #14759

@ikaaasra

Description

@ikaaasra

how to have multiple graphql module with different path with code first approach ... I think when autoSchemaFile is true they search all of project files and produce the schema graphql and when we have another graphql module we get error because it want to generate again the schema ... I use include but it is not work fine for autoSchemaFile instead include it use all of modules .. and it is wrong

import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { UserResolver } from './user.resolver';

@Module({
  imports: [
    GraphQLModule.forRoot({
      autoSchemaFile: 'schema-user.gql',
      include: [UserModule], // Only include this module for schema generation 
                    // but it is not work and generate all of modules entire project
    }),
  ],
  providers: [UserResolver],
})
export class UserModule {}

why ??? how can I fix it ??? thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue has not been looked into

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions