Skip to content

Commit

Permalink
Revert "Fixes remaining Name field in singlefile test"
Browse files Browse the repository at this point in the history
This reverts commit e43ebf7.
  • Loading branch information
johnmaguire committed Oct 27, 2021
1 parent 37fa872 commit d1aa3d8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
21 changes: 11 additions & 10 deletions plugin/resolvergen/testdata/filetemplate/out/schema.custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ func (r *queryCustomResolverType) Resolver(ctx context.Context) (*customresolver
return nil, nil
}

func (r *resolverCustomResolverType) Name(ctx context.Context, obj *customresolver.Resolver) (string, error) {
// CustomerResolverType.Name implementation
return "", nil
}

// Query returns customresolver.QueryResolver implementation.
func (r *CustomResolverType) Query() customresolver.QueryResolver { return &queryCustomResolverType{r} }

// Resolver returns customresolver.ResolverResolver implementation.
func (r *CustomResolverType) Resolver() customresolver.ResolverResolver {
return &resolverCustomResolverType{r}
}

type queryCustomResolverType struct{ *CustomResolverType }
type resolverCustomResolverType struct{ *CustomResolverType }

// !!! WARNING !!!
// The code below was going to be deleted when updating resolvers. It has been copied here so you have
// one last chance to move it out of harms way if you want. There are two reasons this happens:
// - When renaming or deleting a resolver the old code will be put in here. You can safely delete
// it when you're done.
// - You have helper methods in this file. Move them out to keep these resolver files clean.
func (r *resolverCustomResolverType) Name(ctx context.Context, obj *customresolver.Resolver) (string, error) {
// CustomerResolverType.Name implementation
return "", nil
}
func (r *CustomResolverType) Resolver() customresolver.ResolverResolver {
return &resolverCustomResolverType{r}
}

type resolverCustomResolverType struct{ *CustomResolverType }

func AUserHelperFunction() {
// AUserHelperFunction implementation
}
21 changes: 11 additions & 10 deletions plugin/resolvergen/testdata/followschema/out/schema.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ func (r *queryCustomResolverType) Resolver(ctx context.Context) (*customresolver
return nil, nil
}

func (r *resolverCustomResolverType) Name(ctx context.Context, obj *customresolver.Resolver) (string, error) {
// CustomerResolverType.Name implementation
return "", nil
}

// Query returns customresolver.QueryResolver implementation.
func (r *CustomResolverType) Query() customresolver.QueryResolver { return &queryCustomResolverType{r} }

// Resolver returns customresolver.ResolverResolver implementation.
func (r *CustomResolverType) Resolver() customresolver.ResolverResolver {
return &resolverCustomResolverType{r}
}

type queryCustomResolverType struct{ *CustomResolverType }
type resolverCustomResolverType struct{ *CustomResolverType }

// !!! WARNING !!!
// The code below was going to be deleted when updating resolvers. It has been copied here so you have
// one last chance to move it out of harms way if you want. There are two reasons this happens:
// - When renaming or deleting a resolver the old code will be put in here. You can safely delete
// it when you're done.
// - You have helper methods in this file. Move them out to keep these resolver files clean.
func (r *resolverCustomResolverType) Name(ctx context.Context, obj *customresolver.Resolver) (string, error) {
// CustomerResolverType.Name implementation
return "", nil
}
func (r *CustomResolverType) Resolver() customresolver.ResolverResolver {
return &resolverCustomResolverType{r}
}

type resolverCustomResolverType struct{ *CustomResolverType }

func AUserHelperFunction() {
// AUserHelperFunction implementation
}
1 change: 0 additions & 1 deletion plugin/resolvergen/testdata/singlefile/out/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package customresolver
import "context"

type Resolver struct {
Name string
}

type QueryResolver interface {
Expand Down
8 changes: 8 additions & 0 deletions plugin/resolvergen/testdata/singlefile/out/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ func (r *queryCustomResolverType) Resolver(ctx context.Context) (*Resolver, erro
panic("not implemented")
}

func (r *resolverCustomResolverType) Name(ctx context.Context, obj *Resolver) (string, error) {
panic("not implemented")
}

// Query returns QueryResolver implementation.
func (r *CustomResolverType) Query() QueryResolver { return &queryCustomResolverType{r} }

// Resolver returns ResolverResolver implementation.
func (r *CustomResolverType) Resolver() ResolverResolver { return &resolverCustomResolverType{r} }

type queryCustomResolverType struct{ *CustomResolverType }
type resolverCustomResolverType struct{ *CustomResolverType }

0 comments on commit d1aa3d8

Please sign in to comment.