Skip to content

Instantly share code, notes, and snippets.

@manakuro
Created December 10, 2021 04:43
Show Gist options
  • Save manakuro/20688f0778002886f01b4abf80260404 to your computer and use it in GitHub Desktop.
Save manakuro/20688f0778002886f01b4abf80260404 to your computer and use it in GitHub Desktop.
// Resolver is a context struct
type Resolver struct {
client *ent.Client
controller controller.Controller
}
// NewSchema creates NewExecutableSchema
func NewSchema(client *ent.Client, controller controller.Controller) graphql.ExecutableSchema {
return generated.NewExecutableSchema(generated.Config{
Resolvers: &Resolver{
client: client,
controller: controller,
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment