zenyui / gqlgen-dataloader

Demonstrates GqlGen using the graph-gophers/dataloader
27 stars 5 forks source link

LoadMany example #8

Open frederikhors opened 2 years ago

frederikhors commented 2 years ago

@zenyui I think we should add a LoadMany example in your amazing demo project: https://github.com/zenyui/gqlgen-dataloader.

Example:

  1. Get all Players for a Team ID
  2. Get all Players for many Team IDs
zenyui commented 2 years ago

@frederikhors it's a cool idea, but i'm a little concerned about making this sample app too complex. thoughts?

I was thinking about perhaps simplifying it.

frederikhors commented 2 years ago

I think we need it. The life is complex. 😄

zenyui commented 2 years ago

My point is that probably belongs in the docs for the dataloader project, not here. That's a simple client method that you can invoke, not something that relates to wiring the library to gqlgen.

My fear is we will make this sample repo too big.

frederikhors commented 2 years ago

Ok, can you at least enlighten me and add somewhere in the README on the code for the loadmany? We should also use it for the gqlgen docs.

zenyui commented 2 years ago

@frederikhors i think you just invoke LoadMany on this dataloader.Loader instance https://github.com/zenyui/gqlgen-dataloader/blob/main/graph/dataloader/dataloader.go#L28