github.com/jepp2078/gqlgen@v0.7.2/example/todo/models.go (about)

     1  package todo
     2  
     3  type Ownable interface {
     4  	Owner() *User
     5  }
     6  
     7  type Todo struct {
     8  	ID    int
     9  	Text  string
    10  	Done  bool
    11  	owner *User
    12  }
    13  
    14  func (t Todo) Owner() *User {
    15  	return t.owner
    16  }
    17  
    18  type User struct {
    19  	ID   int
    20  	Name string
    21  }