Skip to content

Commit

Permalink
chore: add a type resolver for the NavactionRoute type
Browse files Browse the repository at this point in the history
  • Loading branch information
ochom committed Aug 31, 2021
1 parent f4cab70 commit a90ba10
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
29 changes: 21 additions & 8 deletions pkg/onboarding/presentation/graph/generated/generated.go

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

11 changes: 11 additions & 0 deletions pkg/onboarding/presentation/graph/types.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ import (
"context"

"github.com/savannahghi/onboarding/pkg/onboarding/application/dto"
"github.com/savannahghi/onboarding/pkg/onboarding/domain"
"github.com/savannahghi/onboarding/pkg/onboarding/presentation/graph/generated"
"github.com/savannahghi/profileutils"
"github.com/savannahghi/scalarutils"
)

func (r *navigationActionResolver) OnTapRoute(ctx context.Context, obj *domain.NavigationAction) (string, error) {
return obj.OnTapRoute.String(), nil
}

func (r *userProfileResolver) RoleDetails(ctx context.Context, obj *profileutils.UserProfile) ([]*dto.RoleOutput, error) {
return r.interactor.Role.GetRolesByIDs(ctx, obj.Roles)
}
Expand All @@ -24,6 +29,11 @@ func (r *verifiedIdentifierResolver) Timestamp(ctx context.Context, obj *profile
}, nil
}

// NavigationAction returns generated.NavigationActionResolver implementation.
func (r *Resolver) NavigationAction() generated.NavigationActionResolver {
return &navigationActionResolver{r}
}

// UserProfile returns generated.UserProfileResolver implementation.
func (r *Resolver) UserProfile() generated.UserProfileResolver { return &userProfileResolver{r} }

Expand All @@ -32,5 +42,6 @@ func (r *Resolver) VerifiedIdentifier() generated.VerifiedIdentifierResolver {
return &verifiedIdentifierResolver{r}
}

type navigationActionResolver struct{ *Resolver }
type userProfileResolver struct{ *Resolver }
type verifiedIdentifierResolver struct{ *Resolver }

0 comments on commit a90ba10

Please sign in to comment.