aboutsummaryrefslogblamecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/plugin/resolvergen/resolver.gotpl
blob: 66d6efac25ea1b3aa796fc9139317bb737baeb60 (plain) (tree)





















                                                                                                       
                                                                                     





                                       
                                                                                                      


                                                     
                                                                                                                                                  





                                                        
// THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.

{{ reserveImport "context"  }}
{{ reserveImport "fmt"  }}
{{ reserveImport "io"  }}
{{ reserveImport "strconv"  }}
{{ reserveImport "time"  }}
{{ reserveImport "sync"  }}
{{ reserveImport "errors"  }}
{{ reserveImport "bytes"  }}

{{ reserveImport "github.com/99designs/gqlgen/handler" }}
{{ reserveImport "github.com/vektah/gqlparser" }}
{{ reserveImport "github.com/vektah/gqlparser/ast" }}
{{ reserveImport "github.com/99designs/gqlgen/graphql" }}
{{ reserveImport "github.com/99designs/gqlgen/graphql/introspection" }}

type {{.ResolverType}} struct {}

{{ range $object := .Objects -}}
	{{- if $object.HasResolvers -}}
		func (r *{{$.ResolverType}}) {{$object.Name}}() {{ $object.ResolverInterface | ref }} {
			return &{{lcFirst $object.Name}}{{ucFirst $.ResolverType}}{r}
		}
	{{ end -}}
{{ end }}

{{ range $object := .Objects -}}
	{{- if $object.HasResolvers -}}
		type {{lcFirst $object.Name}}{{ucFirst $.ResolverType}} struct { *{{$.ResolverType}} }

		{{ range $field := $object.Fields -}}
			{{- if $field.IsResolver -}}
			func (r *{{lcFirst $object.Name}}{{ucFirst $.ResolverType}}) {{$field.GoFieldName}}{{ $field.ShortResolverDeclaration }} {
				panic("not implemented")
			}
			{{ end -}}
		{{ end -}}
	{{ end -}}
{{ end }}