Answers for "apollo server build schema passing parameters to classes"

0

apollo server build schema passing parameters to classes

// https://github.com/MichalLytek/type-graphql/blob/master/docs/dependency-injection.md

import { buildSchema } from "type-graphql";
// import your IoC container
import { Container } from "typedi";

import { SampleResolver } from "./resolvers";

// build the schema as always
const schema = await buildSchema({
  resolvers: [SampleResolver],
  // register the 3rd party IOC container
  container: Container,
});
Posted by: Guest on October-29-2020

Code answers related to "apollo server build schema passing parameters to classes"

Code answers related to "Javascript"

Browse Popular Code Answers by Language