Skip to content

Commit

Permalink
Create output directory if not exist + instruction improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLindhout committed Dec 30, 2020
1 parent c6b2b11 commit d80d17e
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ import (

func main() {


output := gbgen.Config{
Directory: "helpers", // supports root or sub directories
PackageName: "helpers",
Expand Down Expand Up @@ -215,34 +216,34 @@ func main() {
backend,
frontend,
gbgen.ResolverPluginConfig{
// Authorization scopes can be used to override e.g. userId, organizationId, tenantId
// This will be resolved used the provided ScopeResolverName if the result of the AddTrigger=true
// You would need this if you don't want to require these fields in your schema but you want to add them
// to the db model.
// If you do have these fields in your schema but want them authorized you could use a gqlgen directive
//AuthorizationScopes: []*gbgen.AuthorizationScope{
// {
// ImportPath: "github.com/yourcompany/backend/auth",
// ImportAlias: "auth",
// ScopeResolverName: "UserIDFromContext", // function which is called with the context of the resolver
// BoilerColumnName: "UserID",
//
// AddHook: func(model *gbgen.BoilerModel, resolver *gbgen.Resolver, templateKey string) bool {
// // fmt.Println(templateKey)
// // templateKey contains a unique where the resolver tries to add something
// // e.g.
// // most of the time you can ignore this
// var addResolver bool
// for _, field := range model.Fields {
// if field.Name == "UserID" {
// addResolver = true
// }
// }
// return addResolver
// },
// },
//},
},
// Authorization scopes can be used to override e.g. userId, organizationId, tenantId
// This will be resolved used the provided ScopeResolverName if the result of the AddTrigger=true
// You would need this if you don't want to require these fields in your schema but you want to add them
// to the db model.
// If you do have these fields in your schema but want them authorized you could use a gqlgen directive
//AuthorizationScopes: []*gbgen.AuthorizationScope{
// {
// ImportPath: "github.com/yourcompany/backend/auth",
// ImportAlias: "auth",
// ScopeResolverName: "UserIDFromContext", // function which is called with the context of the resolver
// BoilerColumnName: "UserID",
//
// AddHook: func(model *gbgen.BoilerModel, resolver *gbgen.Resolver, templateKey string) bool {
// // fmt.Println(templateKey)
// // templateKey contains a unique where the resolver tries to add something
// // e.g.
// // most of the time you can ignore this
// var addResolver bool
// for _, field := range model.Fields {
// if field.Name == "UserID" {
// addResolver = true
// }
// }
// return addResolver
// },
// },
//},
},
)),
); err != nil {
fmt.Println("error while trying generate resolver and converts")
Expand Down

0 comments on commit d80d17e

Please sign in to comment.