-
-
Notifications
You must be signed in to change notification settings - Fork 673
Closed
Labels
Question ❔Not future request, proposal or bug issueNot future request, proposal or bug issueSolved ✔️The issue has been solvedThe issue has been solved
Description
Describe the issue
Currently, the library provides no documentation on how to implement hot module reloading in combination with Webpack. Is it even possible? If so, how can one achieve this?
Are you able to make a PR that fix this?
At the moment, just looking for a hotfix.
index.ts
import "reflect-metadata";
import { ApolloServer } from "apollo-server";
import { environment } from "./Environment";
import { buildSchema } from "type-graphql";
import BoardResolver from "./types/boards/BoardResolver";
async function bootstrap() {
const schema = await buildSchema({
resolvers: [BoardResolver]
});
const server = new ApolloServer({
schema
});
server.listen(environment.port).then(({ url }) => {
console.log(`Server is ready at ${url}`);
});
if (module.hot) {
module.hot.accept();
module.hot.dispose(() => server.stop());
}
}
bootstrap();
Result
Every time I reload a type, the module throws this error:
UnhandledPromiseRejectionWarning: Error: Schema must contain unique named types but contains multiple types named "Board".
fromi
Metadata
Metadata
Assignees
Labels
Question ❔Not future request, proposal or bug issueNot future request, proposal or bug issueSolved ✔️The issue has been solvedThe issue has been solved