-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to emit schema file in offline context #11
Comments
NestJS has some mechanism to do that: However, it doesn't use modules but explicit resolvers class array, which is an awful idea. You can do the same thing just by using I will leave that issue open to create |
@MichalLytek hi, any update on this? |
@MichalLytek It is kind of a blocker for me, as I have a nestjs-powered backend (and I'm using code-first approach) for my graphql schema. And my client app uses graphql-codegen to generate graphql queries - but it needs a schema file to do that. On CI/CD - I want to be able to generate my schema file so that codegen would be able to generate the queries (as I can't start the app on a CI service). The suggested solution with Or the emitted schema file is supposed to be git-tracked? |
@MichalLytek I'm using import 'reflect-metadata';
import { buildSchemaSync } from 'type-graphql';
const schema = buildSchemaSync({
resolvers: [__dirname + '/../src/graphql/**/*.resolvers.ts'],
authChecker: () => true
}); It kinda works, but it exports all Prisma definitions (which I don't need). Emitting the file during runtime (with Any other suggestions? |
@Borales you need to provide the imported resolvers explicitly in order to not emit all prisma definitions. |
Currently, the plugin only emits a schema file on runtime, but this is not ideal for designing a microservice architecture, when other services depend on that schema file for generating their own code.
Is there a possibility to emit the schema file without having to run the NestJS server?
The text was updated successfully, but these errors were encountered: