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

     1  package graphql
     2  
     3  import (
     4  	// embed schema.graphql
     5  	_ "embed"
     6  
     7  	"flamingo.me/flamingo-commerce/v3/price/domain"
     8  	"flamingo.me/graphql"
     9  )
    10  
    11  // Service is the Graphql-Service of this module
    12  type Service struct{}
    13  
    14  var _ graphql.Service = new(Service)
    15  
    16  //go:embed schema.graphql
    17  var schema []byte
    18  
    19  // Schema returns graphql schema of this module
    20  func (*Service) Schema() []byte {
    21  	return schema
    22  }
    23  
    24  // Types configures the GraphQL to Go resolvers
    25  func (*Service) Types(types *graphql.Types) {
    26  	types.Map("Commerce_Price", domain.Price{})
    27  	types.GoField("Commerce_Price", "amount", "FloatAmount")
    28  	types.Map("Commerce_Price_Charges", domain.Charges{})
    29  	types.Map("Commerce_Price_Charge", domain.Charge{})
    30  	types.Map("Commerce_Price_ChargeQualifier", domain.ChargeQualifier{})
    31  	types.Map("Commerce_Price_ChargeQualifierInput", domain.ChargeQualifier{})
    32  }