Skip to content

Instantly share code, notes, and snippets.

@fwojciec
Created January 20, 2020 16:26
Show Gist options
  • Select an option

  • Save fwojciec/5166a3ae41996b05fa9b99435565a7dd to your computer and use it in GitHub Desktop.

Select an option

Save fwojciec/5166a3ae41996b05fa9b99435565a7dd to your computer and use it in GitHub Desktop.

Revisions

  1. fwojciec created this gist Jan 20, 2020.
    3 changes: 3 additions & 0 deletions resolvers.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    func (r *bookResolver) Authors(ctx context.Context, obj *pg.Book) ([]pg.Author, error) {
    return r.DataLoaders.Retrieve(ctx).AuthorsByBookID.Load(obj.ID)
    }