Add base acc server
This commit is contained in:
4139
generated/graphql/exec.go
Normal file
4139
generated/graphql/exec.go
Normal file
File diff suppressed because it is too large
Load Diff
73
generated/graphql/model.go
Normal file
73
generated/graphql/model.go
Normal file
@@ -0,0 +1,73 @@
|
||||
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
||||
|
||||
package graphql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Character interface {
|
||||
IsCharacter()
|
||||
}
|
||||
|
||||
type FriendsConnection struct {
|
||||
TotalCount int `json:"totalCount"`
|
||||
Friends []Character `json:"friends"`
|
||||
}
|
||||
|
||||
type Human struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Friends []*Human `json:"friends"`
|
||||
Height *Unit `json:"height"`
|
||||
FriendsConnection *FriendsConnection `json:"friendsConnection"`
|
||||
}
|
||||
|
||||
func (Human) IsCharacter() {}
|
||||
|
||||
type Unit struct {
|
||||
Value float64 `json:"value"`
|
||||
}
|
||||
|
||||
type LengthUnit string
|
||||
|
||||
const (
|
||||
LengthUnitMeter LengthUnit = "Meter"
|
||||
LengthUnitFeet LengthUnit = "Feet"
|
||||
)
|
||||
|
||||
var AllLengthUnit = []LengthUnit{
|
||||
LengthUnitMeter,
|
||||
LengthUnitFeet,
|
||||
}
|
||||
|
||||
func (e LengthUnit) IsValid() bool {
|
||||
switch e {
|
||||
case LengthUnitMeter, LengthUnitFeet:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (e LengthUnit) String() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
func (e *LengthUnit) UnmarshalGQL(v interface{}) error {
|
||||
str, ok := v.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("enums must be strings")
|
||||
}
|
||||
|
||||
*e = LengthUnit(str)
|
||||
if !e.IsValid() {
|
||||
return fmt.Errorf("%s is not a valid LengthUnit", str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e LengthUnit) MarshalGQL(w io.Writer) {
|
||||
fmt.Fprint(w, strconv.Quote(e.String()))
|
||||
}
|
Reference in New Issue
Block a user