William Petit
676ddf3bc8
Types: type Workgroup { id: ID! name: String createdAt: Time! closedAt: Time members: [User]! } Mutations: joinWorkgroup(workgroupId: ID!): Workgroup! leaveWorkgroup(workgroupId: ID!): Workgroup! createWorkgroup(changes: WorkgroupChanges!): Workgroup! closeWorkgroup(workgroupId: ID!): Workgroup! updateWorkgroup(workgroupId: ID!, changes: WorkgroupChanges!): Workgroup! Queries: workgroups: [Workgroup]!
20 lines
369 B
Go
20 lines
369 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
Name *string `json:"name"`
|
|
Email string `json:"email" gorm:"unique;not null"`
|
|
ConnectedAt time.Time `json:"connectedAt"`
|
|
Workgroups []*Workgroup `gorm:"many2many:users_workgroups;"`
|
|
}
|
|
|
|
type ProfileChanges struct {
|
|
Name *string `json:"name"`
|
|
}
|