JS Party: JavaScript, CSS, Web Development cover image

The ORMazing show

JS Party: JavaScript, CSS, Web Development

CHAPTER

GraphQL Context Parameters for Entity Managers

So when we boot up our GraphQL server, it's going to ask for a fast-to-wide request entity. And that's where we're like, oh, okay, this is a new request. Let's make a new entity manager. So you could do, actually, we do that first. We've got middleware that first sets like request.context. Some pastify handlers also have access to the request context and hence the entity manager if they wanted to do anything. But then most of our stuff ends up being GraphQL mutations that then, you know, uses that context parameter to get the entity manager out of the request contexts and do any loads or do any saves

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner