-
Notifications
You must be signed in to change notification settings - Fork 77
/
service.go
31 lines (26 loc) · 1.09 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package graphql
import (
"flamingo.me/flamingo-commerce/v3/search/application"
"flamingo.me/flamingo-commerce/v3/search/domain"
"flamingo.me/flamingo-commerce/v3/search/interfaces/graphql/dto"
"flamingo.me/graphql"
"github.com/99designs/gqlgen/codegen/config"
)
//go:generate go run github.com/go-bindata/go-bindata/go-bindata -nometadata -o fs.go -pkg graphql schema.graphql
// Service is the Graphql-Service of this module
type Service struct{}
// Schema returns graphql schema of this module
func (*Service) Schema() []byte {
return MustAsset("schema.graphql")
}
// Models return the 'Schema name' => 'Go model' mapping of this module
func (*Service) Models() map[string]config.TypeMapEntry {
return graphql.ModelMap{
"Commerce_Search_Meta": domain.SearchMeta{},
"Commerce_Search_Request": dto.CommerceSearchRequest{},
"Commerce_Search_KeyValueFilter": dto.CommerceSearchKeyValueFilter{},
"Commerce_Search_Suggestion": domain.Suggestion{},
"Commerce_Search_Result": application.SearchResult{},
"Commerce_Search_SortOption": domain.SortOption{},
}.Models()
}