mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
* 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
28 lines
897 B
Go
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
|
|
}
|