mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
14 lines
387 B
TypeScript
14 lines
387 B
TypeScript
import { GraphQLSchema } from "graphql";
|
|
import { Db } from "mongodb";
|
|
|
|
import { Config } from "talk-server/config";
|
|
import { graphqlMiddleware } from "talk-server/graph/common/middleware";
|
|
|
|
import Context from "./context";
|
|
|
|
export default (schema: GraphQLSchema, config: Config, db: Db) =>
|
|
graphqlMiddleware(config, async () => ({
|
|
schema,
|
|
context: new Context({ db }),
|
|
}));
|