Skip to content

Commit

Permalink
Fixed chatroom#Messages type
Browse files Browse the repository at this point in the history
  • Loading branch information
moofMonkey committed May 26, 2022
1 parent 0730d8f commit e8e4ec3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _examples/chat/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type Observer struct {

type Chatroom struct {
Name string
Messages []*Message
Messages []Message
Observers sync.Map
}

Expand All @@ -72,7 +72,7 @@ func (r *mutationResolver) Post(ctx context.Context, text string, username strin
CreatedBy: username,
}

room.Messages = append(room.Messages, message)
room.Messages = append(room.Messages, *message)
room.Observers.Range(func(_, v interface{}) bool {
observer := v.(*Observer)
if observer.Username == "" || observer.Username == message.CreatedBy {
Expand Down

0 comments on commit e8e4ec3

Please sign in to comment.