Skip to content

Commit

Permalink
build context earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
beeequeue committed Jun 22, 2024
1 parent 95f2547 commit 68fb9f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const buildContext: MiddlewareHandler<{ Variables: Variables }> = async (c, next

export const buildApp = async (schema: NexusGraphQLSchema) => {
return new Hono<{ Variables: Variables }>()
.use("*", buildContext)
.use("*", async (c, next) => {
const start = Date.now()
c.var.logger.info(
Expand All @@ -67,5 +68,5 @@ export const buildApp = async (schema: NexusGraphQLSchema) => {
})
.use("*", cors({ credentials: true, origin: (origin) => origin }))
.use("*", secureHeaders())
.post("/graphql", buildContext, graphqlServer({ schema }))
.post("/graphql", graphqlServer({ schema }))
}

0 comments on commit 68fb9f7

Please sign in to comment.