flamingo.me/flamingo-commerce/v3@v3.11.0/customer/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/customer/domain"
    10  	"flamingo.me/flamingo-commerce/v3/customer/interfaces/graphql/dtocustomer"
    11  )
    12  
    13  // Service is the Graphql-Service of this module
    14  type Service struct{}
    15  
    16  var _ graphql.Service = new(Service)
    17  
    18  //go:embed schema.graphql
    19  var schema []byte
    20  
    21  // Schema returns graphql schema of this module
    22  func (*Service) Schema() []byte {
    23  	return schema
    24  }
    25  
    26  // Types configures the GraphQL to Go resolvers
    27  func (*Service) Types(types *graphql.Types) {
    28  	types.Map("Commerce_Customer_Status_Result", dtocustomer.CustomerStatusResult{})
    29  	types.Map("Commerce_Customer_Result", dtocustomer.CustomerResult{})
    30  	types.Map("Commerce_Customer_PersonData", domain.PersonData{})
    31  	types.Map("Commerce_Customer_Address", domain.Address{})
    32  	types.GoField("Commerce_Customer_Address", "streetNumber", "StreetNr")
    33  	types.Resolve("Query", "Commerce_Customer_Status", CustomerResolver{}, "CommerceCustomerStatus")
    34  	types.Resolve("Query", "Commerce_Customer", CustomerResolver{}, "CommerceCustomer")
    35  }