2023-07-21 15:16:35 -06:00
|
|
|
package graphvent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/graphql-go/graphql"
|
|
|
|
)
|
|
|
|
|
2023-07-21 17:49:19 -06:00
|
|
|
var GQLTypeSignal = NewSingleton(func() *graphql.Object {
|
|
|
|
gql_type_signal := graphql.NewObject(graphql.ObjectConfig{
|
2023-07-22 20:21:17 -06:00
|
|
|
Name: "Signal",
|
2023-07-21 17:49:19 -06:00
|
|
|
IsTypeOf: func(p graphql.IsTypeOfParams) bool {
|
2023-07-26 15:08:14 -06:00
|
|
|
_, ok := p.Value.(Signal)
|
2023-07-21 17:49:19 -06:00
|
|
|
return ok
|
|
|
|
},
|
|
|
|
Fields: graphql.Fields{},
|
|
|
|
})
|
|
|
|
|
|
|
|
gql_type_signal.AddFieldConfig("Type", &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
Resolve: GQLSignalType,
|
|
|
|
})
|
|
|
|
gql_type_signal.AddFieldConfig("Direction", &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
Resolve: GQLSignalDirection,
|
|
|
|
})
|
|
|
|
gql_type_signal.AddFieldConfig("String", &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
Resolve: GQLSignalString,
|
|
|
|
})
|
2023-07-21 15:16:35 -06:00
|
|
|
return gql_type_signal
|
2023-07-21 17:49:19 -06:00
|
|
|
}, nil)
|
|
|
|
|