Files
stash/vendor/github.com/Yamashou/gqlgenc/clientgen/template.go
WithoutPants 7a45943e8e Stash box client interface (#751)
* Add gql client generation files
* Update dependencies
* Add stash-box client generation to the makefile
* Move scraped scene object matchers to models
* Add stash-box to scrape with dropdown
* Add scrape scene from fingerprint in UI
2020-09-17 19:57:18 +10:00

28 lines
897 B
Go

package clientgen
import (
"github.com/99designs/gqlgen/codegen/config"
"github.com/99designs/gqlgen/codegen/templates"
"golang.org/x/xerrors"
)
func RenderTemplate(cfg *config.Config, query *Query, mutation *Mutation, fragments []*Fragment, operations []*Operation, operationResponses []*OperationResponse, client config.PackageConfig) error {
if err := templates.Render(templates.Options{
PackageName: client.Package,
Filename: client.Filename,
Data: map[string]interface{}{
"Query": query,
"Mutation": mutation,
"Fragment": fragments,
"Operation": operations,
"OperationResponse": operationResponses,
},
Packages: cfg.Packages,
PackageDoc: "// Code generated by github.com/Yamashou/gqlgenc, DO NOT EDIT.\n",
}); err != nil {
return xerrors.Errorf("%s generating failed: %w", client.Filename, err)
}
return nil
}