Avoid circular imports

This commit is contained in:
Jordan Eldredge 2025-11-03 20:15:00 -05:00
parent af21934296
commit 18ee5418b6

View file

@ -1,8 +1,3 @@
import { Router } from "express";
import { createYoga, YogaInitialContext } from "graphql-yoga";
// import DEFAULT_QUERY from "./defaultQuery";
import { getSchema } from "./schema";
import UserContext from "../../data/UserContext.js";
/** @gqlContext */
@ -13,17 +8,3 @@ export function getUserContext(ctx: Ctx): UserContext {
return ctx.ctx;
}
const router = Router();
const yoga = createYoga({
schema: getSchema(),
context: (ctx: YogaInitialContext) => {
// @ts-expect-error
return ctx.req;
},
});
// Bind GraphQL Yoga to the graphql endpoint to avoid rendering the playground on any path
router.use("", yoga);
export default router;