gen_models.go

 1// Code generated by github.com/vektah/gqlgen, DO NOT EDIT.
 2
 3package models
 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   Operation `json:"node"`
47}
48type PageInfo struct {
49	HasNextPage     bool `json:"hasNextPage"`
50	HasPreviousPage bool `json:"hasPreviousPage"`
51}
52
53type Status string
54
55const (
56	StatusOpen   Status = "OPEN"
57	StatusClosed Status = "CLOSED"
58)
59
60func (e Status) IsValid() bool {
61	switch e {
62	case StatusOpen, StatusClosed:
63		return true
64	}
65	return false
66}
67
68func (e Status) String() string {
69	return string(e)
70}
71
72func (e *Status) UnmarshalGQL(v interface{}) error {
73	str, ok := v.(string)
74	if !ok {
75		return fmt.Errorf("enums must be strings")
76	}
77
78	*e = Status(str)
79	if !e.IsValid() {
80		return fmt.Errorf("%s is not a valid Status", str)
81	}
82	return nil
83}
84
85func (e Status) MarshalGQL(w io.Writer) {
86	fmt.Fprint(w, strconv.Quote(e.String()))
87}