gen_model.go

 1// Code generated by github.com/vektah/gqlgen, DO NOT EDIT.
 2
 3package resolvers
 4
 5import (
 6	fmt "fmt"
 7	io "io"
 8	strconv "strconv"
 9
10	bug "github.com/MichaelMure/git-bug/bug"
11)
12
13type Authored interface{}
14type BugConnection struct {
15	Edges      []*BugEdge `json:"edges"`
16	PageInfo   PageInfo   `json:"pageInfo"`
17	TotalCount int        `json:"totalCount"`
18}
19type BugEdge struct {
20	Cursor string       `json:"cursor"`
21	Node   bug.Snapshot `json:"node"`
22}
23type CommentConnection struct {
24	Edges      []CommentEdge `json:"edges"`
25	PageInfo   PageInfo      `json:"pageInfo"`
26	TotalCount int           `json:"totalCount"`
27}
28type CommentEdge struct {
29	Cursor string      `json:"cursor"`
30	Node   bug.Comment `json:"node"`
31}
32type ConnectionInput struct {
33	After  *string `json:"after"`
34	Before *string `json:"before"`
35	First  *int    `json:"first"`
36	Last   *int    `json:"last"`
37}
38type Operation interface{}
39type OperationConnection struct {
40	Edges      []OperationEdge `json:"edges"`
41	PageInfo   PageInfo        `json:"pageInfo"`
42	TotalCount int             `json:"totalCount"`
43}
44type OperationEdge struct {
45	Cursor string         `json:"cursor"`
46	Node   OperationUnion `json:"node"`
47}
48type OperationUnion interface{}
49type PageInfo struct {
50	HasNextPage     bool `json:"hasNextPage"`
51	HasPreviousPage bool `json:"hasPreviousPage"`
52}
53
54type Status string
55
56const (
57	StatusOpen   Status = "OPEN"
58	StatusClosed Status = "CLOSED"
59)
60
61func (e Status) IsValid() bool {
62	switch e {
63	case StatusOpen, StatusClosed:
64		return true
65	}
66	return false
67}
68
69func (e Status) String() string {
70	return string(e)
71}
72
73func (e *Status) UnmarshalGQL(v interface{}) error {
74	str, ok := v.(string)
75	if !ok {
76		return fmt.Errorf("enums must be strings")
77	}
78
79	*e = Status(str)
80	if !e.IsValid() {
81		return fmt.Errorf("%s is not a valid Status", str)
82	}
83	return nil
84}
85
86func (e Status) MarshalGQL(w io.Writer) {
87	fmt.Fprint(w, strconv.Quote(e.String()))
88}