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]!
19 lines
291 B
Go
19 lines
291 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
type Workgroup struct {
|
|
gorm.Model
|
|
Name *string `json:"name"`
|
|
ClosedAt time.Time `json:"closedAt"`
|
|
Members []*User `gorm:"many2many:users_workgroups;"`
|
|
}
|
|
|
|
type WorkgroupChanges struct {
|
|
Name *string `json:"name"`
|
|
}
|