32 lines
743 B
Go
32 lines
743 B
Go
package graphvent
|
|
|
|
import (
|
|
"github.com/graphql-go/graphql"
|
|
)
|
|
|
|
var GQLTypeSignal = NewSingleton(func() *graphql.Object {
|
|
gql_type_signal := graphql.NewObject(graphql.ObjectConfig{
|
|
Name: "Signal",
|
|
IsTypeOf: func(p graphql.IsTypeOfParams) bool {
|
|
_, ok := p.Value.(Signal)
|
|
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,
|
|
})
|
|
return gql_type_signal
|
|
}, nil)
|
|
|