NestJS + Graphql generate type file into the source shcme folder, not src directionary

NestJS + Graphql generate type file into the source shcme folder, not src directionary


0

I use NestJS with Graphql, and want to genrate type file with the schema.

generate type code

import { GraphQLDefinitionsFactory } from '@nestjs/graphql';
import { join } from 'path';

const definitionsFactory = new GraphQLDefinitionsFactory();
definitionsFactory.generate({
  typePaths: ['./src/**/*.graphql'],
  path: join(process.cwd(), 'src/**/*.ts'),
  outputAs: 'class',
  watch: true,
  emitTypenameField: true,
});

above code generate graphql.ts, but i want to generate users.ts in users folder

NestJS + Graphql generate type file into the source shcme folder, not src directionary

here is what i want to generate type file dirctionary

NestJS + Graphql generate type file into the source shcme folder, not src directionary


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *