Skip to content

Instantly share code, notes, and snippets.

@fwojciec
Created January 20, 2020 15:56
Show Gist options
  • Save fwojciec/e0e8e53f6bc42bf454f85e9ac6e4afa8 to your computer and use it in GitHub Desktop.
Save fwojciec/e0e8e53f6bc42bf454f85e9ac6e4afa8 to your computer and use it in GitHub Desktop.
gqlserver2: dataloaders1
package dataloaders
import (
"context"
"github.com/[username]/gqlgen-sqlc-example/pg" // update the username
)
type contextKey string
const key = contextKey("dataloaders")
// Loaders holds references to the individual dataloaders.
type Loaders struct {
// individual loaders will be defined here
}
func newLoaders(ctx context.Context, repo pg.Repository) *Loaders {
return &Loaders{
// individual loaders will be initialized here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment