preetjdp / YouOweMe

Making it simpler to track those chillars
9 stars 6 forks source link

Implement dataloader #37

Closed preetjdp closed 4 years ago

preetjdp commented 4 years ago

What Does this PR do?.

Adds Dataloader to the server to batch and cache User queries.

Describe In brief the solution / approach you've gone with.

The approach used here uses Dataloader of which a new instance is created on every new connection.

The Dataloader is then made available using dependency injection mentioned here. https://github.com/MichalLytek/type-graphql/issues/51#issuecomment-626719854

Describe alternatives you may have considered

Cons of this approach Would be difficult to maintain the lifecycle of the Dataloader and may lead to significant memory leaks and hell.

Additional context / quirks

Add any other context, screenshots, or quirks about the implmentation here.