gqlgen: github.com/99designs/gqlgen/example/starwars/models Index | Files

package models

import "github.com/99designs/gqlgen/example/starwars/models"

Index

Package Files

generated.go model.go

Variables

var AllEpisode = []Episode{
    EpisodeNewhope,
    EpisodeEmpire,
    EpisodeJedi,
}
var AllLengthUnit = []LengthUnit{
    LengthUnitMeter,
    LengthUnitFoot,
}

func EncodeCursor Uses

func EncodeCursor(i int) string

type Character Uses

type Character interface {
    IsCharacter()
}

type CharacterFields Uses

type CharacterFields struct {
    ID        string
    Name      string
    FriendIds []string
    AppearsIn []Episode
}

type Droid Uses

type Droid struct {
    CharacterFields
    PrimaryFunction string
}

func (Droid) IsCharacter Uses

func (Droid) IsCharacter()

func (Droid) IsSearchResult Uses

func (Droid) IsSearchResult()

type Episode Uses

type Episode string
const (
    EpisodeNewhope Episode = "NEWHOPE"
    EpisodeEmpire  Episode = "EMPIRE"
    EpisodeJedi    Episode = "JEDI"
)

func (Episode) IsValid Uses

func (e Episode) IsValid() bool

func (Episode) MarshalGQL Uses

func (e Episode) MarshalGQL(w io.Writer)

func (Episode) String Uses

func (e Episode) String() string

func (*Episode) UnmarshalGQL Uses

func (e *Episode) UnmarshalGQL(v interface{}) error

type FriendsConnection Uses

type FriendsConnection struct {
    Ids  []string
    From int
    To   int
}

func (*FriendsConnection) PageInfo Uses

func (f *FriendsConnection) PageInfo() PageInfo

func (*FriendsConnection) TotalCount Uses

func (f *FriendsConnection) TotalCount() int

type FriendsEdge Uses

type FriendsEdge struct {
    Cursor string    `json:"cursor"`
    Node   Character `json:"node"`
}

type Human Uses

type Human struct {
    CharacterFields
    StarshipIds  []string
    HeightMeters float64
    Mass         float64
}

func (*Human) Height Uses

func (h *Human) Height(unit LengthUnit) float64

func (Human) IsCharacter Uses

func (Human) IsCharacter()

func (Human) IsSearchResult Uses

func (Human) IsSearchResult()

type LengthUnit Uses

type LengthUnit string
const (
    LengthUnitMeter LengthUnit = "METER"
    LengthUnitFoot  LengthUnit = "FOOT"
)

func (LengthUnit) IsValid Uses

func (e LengthUnit) IsValid() bool

func (LengthUnit) MarshalGQL Uses

func (e LengthUnit) MarshalGQL(w io.Writer)

func (LengthUnit) String Uses

func (e LengthUnit) String() string

func (*LengthUnit) UnmarshalGQL Uses

func (e *LengthUnit) UnmarshalGQL(v interface{}) error

type PageInfo Uses

type PageInfo struct {
    StartCursor string `json:"startCursor"`
    EndCursor   string `json:"endCursor"`
    HasNextPage bool   `json:"hasNextPage"`
}

type Review Uses

type Review struct {
    Stars      int
    Commentary *string
    Time       time.Time
}

type SearchResult Uses

type SearchResult interface {
    IsSearchResult()
}

type Starship Uses

type Starship struct {
    ID      string  `json:"id"`
    Name    string  `json:"name"`
    Length  float64 `json:"length"`
    History [][]int `json:"history"`
}

func (Starship) IsSearchResult Uses

func (Starship) IsSearchResult()

Package models imports 5 packages (graph) and is imported by 4 packages. Updated 2019-03-05. Refresh now. Tools for package owners.