github.com/maeglindeveloper/gqlgen@v0.13.1-0.20210413081235-57808b12a0a0/example/federation/reviews/graph/entity.resolvers.go (about)

     1  package graph
     2  
     3  // This file will be automatically regenerated based on the schema, any resolver implementations
     4  // will be copied through when generating and any unknown code will be moved to the end.
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/99designs/gqlgen/example/federation/reviews/graph/generated"
    10  	"github.com/99designs/gqlgen/example/federation/reviews/graph/model"
    11  )
    12  
    13  func (r *entityResolver) FindProductByUpc(ctx context.Context, upc string) (*model.Product, error) {
    14  	return &model.Product{
    15  		Upc: upc,
    16  	}, nil
    17  }
    18  
    19  func (r *entityResolver) FindUserByID(ctx context.Context, id string) (*model.User, error) {
    20  	return &model.User{
    21  		ID: id,
    22  	}, nil
    23  }
    24  
    25  // Entity returns generated.EntityResolver implementation.
    26  func (r *Resolver) Entity() generated.EntityResolver { return &entityResolver{r} }
    27  
    28  type entityResolver struct{ *Resolver }