flamingo.me/flamingo-commerce/v3@v3.11.0/search/interfaces/graphql/service.go (about)

     1  package graphql
     2  
     3  import (
     4  	// embed schema.graphql
     5  	_ "embed"
     6  
     7  	"flamingo.me/graphql"
     8  
     9  	"flamingo.me/flamingo-commerce/v3/search/application"
    10  	"flamingo.me/flamingo-commerce/v3/search/domain"
    11  	"flamingo.me/flamingo-commerce/v3/search/interfaces/graphql/searchdto"
    12  )
    13  
    14  // Service is the Graphql-Service of this module
    15  type Service struct{}
    16  
    17  var _ graphql.Service = new(Service)
    18  
    19  //go:embed schema.graphql
    20  var schema []byte
    21  
    22  // Schema returns graphql schema of this module
    23  func (*Service) Schema() []byte {
    24  	return schema
    25  }
    26  
    27  // Types configures the GraphQL to Go resolvers
    28  func (*Service) Types(types *graphql.Types) {
    29  	types.Map("Commerce_Search_Meta", domain.SearchMeta{})
    30  	types.Resolve("Commerce_Search_Meta", "sortOptions", CommerceSearchQueryResolver{}, "SortOptions")
    31  	types.Map("Commerce_Search_Request", searchdto.CommerceSearchRequest{})
    32  	types.Map("Commerce_Search_KeyValueFilter", searchdto.CommerceSearchKeyValueFilter{})
    33  	types.Map("Commerce_Search_Suggestion", domain.Suggestion{})
    34  	types.Map("Commerce_Search_Action", domain.Action{})
    35  	types.Map("Commerce_Search_Result", application.SearchResult{})
    36  	types.Map("Commerce_Search_SortOption", searchdto.CommerceSearchSortOption{})
    37  	types.Map("Commerce_Search_Facet", new(searchdto.CommerceSearchFacet))
    38  	types.Map("Commerce_Search_ListFacet", searchdto.CommerceSearchListFacet{})
    39  	types.Map("Commerce_Search_TreeFacet", searchdto.CommerceSearchTreeFacet{})
    40  	types.Map("Commerce_Search_RangeFacet", searchdto.CommerceSearchRangeFacet{})
    41  	types.Map("Commerce_Search_FacetItem", new(searchdto.CommerceSearchFacetItem))
    42  	types.Map("Commerce_Search_ListFacetItem", searchdto.CommerceSearchListFacetItem{})
    43  	types.Map("Commerce_Search_TreeFacetItem", searchdto.CommerceSearchTreeFacetItem{})
    44  	types.Map("Commerce_Search_RangeFacetItem", searchdto.CommerceSearchRangeFacetItem{})
    45  	types.Map("Commerce_Search_Promotion", searchdto.PromotionDTO{})
    46  	types.Map("Commerce_Search_PromotionMedia", domain.Media{})
    47  }