代码拉取完成,页面将自动刷新
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package type_system_extension
import (
"fmt"
"io"
"strconv"
)
type Data interface {
IsData()
}
type Node interface {
IsNode()
}
type Todo struct {
ID string `json:"id"`
Text string `json:"text"`
State State `json:"state"`
Verified bool `json:"verified"`
}
func (Todo) IsNode() {}
func (Todo) IsData() {}
type TodoInput struct {
Text string `json:"text"`
}
type State string
const (
StateNotYet State = "NOT_YET"
StateDone State = "DONE"
)
func (e State) IsValid() bool {
switch e {
case StateNotYet, StateDone:
return true
}
return false
}
func (e State) String() string {
return string(e)
}
func (e *State) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = State(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid State", str)
}
return nil
}
func (e State) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。