Skip to content

Commit

Permalink
Fix other tests with pointer change
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathew Byrne committed Oct 2, 2018
1 parent 20add12 commit 2432ab3
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 31 deletions.
17 changes: 11 additions & 6 deletions example/scalars/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/scalars/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *queryResolver) User(ctx context.Context, id external.ObjectID) (*model.
}, nil
}

func (r *queryResolver) Search(ctx context.Context, input model.SearchArgs) ([]model.User, error) {
func (r *queryResolver) Search(ctx context.Context, input *model.SearchArgs) ([]model.User, error) {
location := model.Point{X: 1, Y: 2}
if input.Location != nil {
location = *input.Location
Expand Down
34 changes: 22 additions & 12 deletions example/starwars/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions example/starwars/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ func (r *mutationResolver) CreateReview(ctx context.Context, episode Episode, re

type queryResolver struct{ *Resolver }

func (r *queryResolver) Hero(ctx context.Context, episode Episode) (Character, error) {
if episode == EpisodeEmpire {
func (r *queryResolver) Hero(ctx context.Context, episode *Episode) (Character, error) {
if *episode == EpisodeEmpire {
return r.humans["1000"], nil
}
return r.droid["2001"], nil
Expand Down Expand Up @@ -193,8 +193,8 @@ func (r *queryResolver) Starship(ctx context.Context, id string) (*Starship, err

type starshipResolver struct{ *Resolver }

func (r *starshipResolver) Length(ctx context.Context, obj *Starship, unit LengthUnit) (float64, error) {
switch unit {
func (r *starshipResolver) Length(ctx context.Context, obj *Starship, unit *LengthUnit) (float64, error) {
switch *unit {
case LengthUnitMeter, "":
return obj.Length, nil
case LengthUnitFoot:
Expand Down
17 changes: 11 additions & 6 deletions integration/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions integration/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func (r *elementResolver) Child(ctx context.Context, obj *models.Element) (model

type queryResolver struct{ *Resolver }

func (r *queryResolver) Error(ctx context.Context, typeArg models.ErrorType) (bool, error) {
if typeArg == models.ErrorTypeCustom {
func (r *queryResolver) Error(ctx context.Context, typeArg *models.ErrorType) (bool, error) {
if *typeArg == models.ErrorTypeCustom {
return false, &CustomError{"User message", "Internal Message"}
}

Expand Down

0 comments on commit 2432ab3

Please sign in to comment.