Browse Source

Fixed bug in resolver array conversion that caused results to all be copied of the last element.

thegreatrefactor
Gisle Aune 6 years ago
parent
commit
2fb391321e
  1. 4
      graph2/queries/changes.go
  2. 4
      graph2/queries/channel.go
  3. 4
      graph2/queries/character.go
  4. 4
      graph2/queries/file.go
  5. 4
      graph2/queries/log.go
  6. 8
      graph2/queries/post.go
  7. 4
      graph2/queries/story.go
  8. 4
      graph2/queries/tags.go
  9. 4
      graph2/queries/unknownnicks.go
  10. 4
      graph2/types/chapter.go
  11. 8
      graph2/types/log.go
  12. 4
      graph2/types/story.go

4
graph2/queries/changes.go

@ -17,8 +17,8 @@ func (r *resolver) Changes(ctx context.Context, filter *changes.Filter) ([]*mode
}
changes2 := make([]*models.Change, len(changes))
for i, change := range changes {
changes2[i] = &change
for i := range changes {
changes2[i] = &changes[i]
}
return changes2, nil

4
graph2/queries/channel.go

@ -30,8 +30,8 @@ func (r *resolver) Channels(ctx context.Context, filter *channels.Filter) ([]*mo
}
channels2 := make([]*models.Channel, len(channels))
for i, channel := range channels {
channels2[i] = &channel
for i := range channels {
channels2[i] = &channels[i]
}
return channels2, nil

4
graph2/queries/character.go

@ -43,8 +43,8 @@ func (r *resolver) Characters(ctx context.Context, filter *characters.Filter) ([
}
characters2 := make([]*models.Character, len(characters))
for i, character := range characters {
characters2[i] = &character
for i := range characters {
characters2[i] = &characters[i]
}
return characters2, nil

4
graph2/queries/file.go

@ -39,8 +39,8 @@ func (r *resolver) Files(ctx context.Context, filter *files.Filter) ([]*models.F
}
files2 := make([]*models.File, len(files))
for i, file := range files {
files2[i] = &file
for i := range files {
files2[i] = &files[i]
}
return files2, nil

4
graph2/queries/log.go

@ -57,8 +57,8 @@ func (r *resolver) Logs(ctx context.Context, filter *logs.Filter) ([]*models.Log
}
logs2 := make([]*models.Log, len(logs))
for i, log := range logs {
logs2[i] = &log
for i := range logs {
logs2[i] = &logs[i]
}
return logs2, nil

8
graph2/queries/post.go

@ -49,8 +49,8 @@ func (r *resolver) Posts(ctx context.Context, filter *posts.Filter) ([]*models.P
}
posts2 := make([]*models.Post, len(posts))
for i, post := range posts {
posts2[i] = &post
for i := range posts {
posts2[i] = &posts[i]
}
return posts2, nil
@ -145,8 +145,8 @@ func (r *mutationResolver) MovePost(ctx context.Context, input input.PostMoveInp
}()
posts2 := make([]*models.Post, len(posts))
for i, post := range posts {
posts2[i] = &post
for i := range posts {
posts2[i] = &posts[i]
}
return posts2, nil

4
graph2/queries/story.go

@ -44,8 +44,8 @@ func (r *resolver) Stories(ctx context.Context, filter *stories.Filter) ([]*mode
}
stories2 := make([]*models.Story, len(stories))
for i, story := range stories {
stories2[i] = &story
for i := range stories {
stories2[i] = &stories[i]
}
return stories2, nil

4
graph2/queries/tags.go

@ -14,8 +14,8 @@ func (r *resolver) Tags(ctx context.Context) ([]*models.Tag, error) {
}
tags2 := make([]*models.Tag, len(tags))
for i, tag := range tags {
tags2[i] = &tag
for i := range tags {
tags2[i] = &tags[i]
}
return tags2, nil

4
graph2/queries/unknownnicks.go

@ -25,8 +25,8 @@ func (r *resolver) UnknownNicks(ctx context.Context, filter *input.UnknownNicksF
}
nicks2 := make([]*models.UnknownNick, len(nicks))
for i, nick := range nicks {
nicks2[i] = &nick
for i := range nicks {
nicks2[i] = &nicks[i]
}
return nicks2, nil

4
graph2/types/chapter.go

@ -39,8 +39,8 @@ func (r *chapterResolver) Comments(ctx context.Context, chapter *models.Chapter,
}
comments2 := make([]*models.Comment, len(comments))
for i, comment := range comments {
comments2[i] = &comment
for i := range comments {
comments2[i] = &comments[i]
}
return comments2, nil

8
graph2/types/log.go

@ -32,8 +32,8 @@ func (r *logResolver) Characters(ctx context.Context, log *models.Log) ([]*model
}
characters2 := make([]*models.Character, len(characters))
for i, character := range characters {
characters2[i] = &character
for i := range characters {
characters2[i] = &characters[i]
}
return characters2, nil
@ -46,8 +46,8 @@ func (r *logResolver) Posts(ctx context.Context, log *models.Log, kinds []string
}
posts2 := make([]*models.Post, len(posts))
for i, post := range posts {
posts2[i] = &post
for i := range posts {
posts2[i] = &posts[i]
}
return posts2, nil

4
graph2/types/story.go

@ -26,8 +26,8 @@ func (r *storyResolver) Chapters(ctx context.Context, story *models.Story) ([]*m
}
chapters2 := make([]*models.Chapter, len(chapters))
for i, chapter := range chapters {
chapters2[i] = &chapter
for i := range chapters {
chapters2[i] = &chapters[i]
}
return chapters2, nil

Loading…
Cancel
Save