Documentation ¶
Index ¶
- Constants
- func CoerceScalarType(typ string) *graphql.Scalar
- func CoerceType(typ ast.Type, typMap map[string]graphql.Type) graphql.Type
- func GetAstStringValue(val interface{}) string
- func GetError(errConst int, triggerName string, params ...interface{}) error
- func GetInterfaceOrUnionType(typ graphql.Output) graphql.Type
- func GetMessage(msgConst int, params ...interface{}) string
- func GetValue(val ast.Value) interface{}
- func IsScalarType(t string) bool
- type Factory
- type HandlerSettings
- type Output
- type Reply
- type RequestOptions
- type Server
- type Settings
- type Trigger
Constants ¶
const ( //Info Messages TriggerInitialize = 1001 StartingServer = 1002 ServerProperties = 1003 CORSPreFlight = 1004 //Debug Message ExecutingMethod = 2001 InterfaceUnionResolver = 2002 QueryType = 2003 MutationType = 2004 Schema = 2005 ReceivedRequest = 2006 FieldResolver = 2007 GraphQLRequest = 2008 GraphQLResponse = 2009 FlowReturnValue = 2010 //Error Messages DefaultError = 4001 ParsingSchemaError = 4002 BuildingSchemaError = 4003 MissingServerKeyError = 4004 GraphqlError = 4005 ErrorProcessingRequest = 4006 ErrorLoadingCertsFromFile = 4007 )
Constants
Variables ¶
This section is empty.
Functions ¶
func CoerceScalarType ¶
CoerceScalarType converts type to graphql.Scalar
func CoerceType ¶
CoerceType converts ast.Type to graphql.Type
func GetAstStringValue ¶
func GetAstStringValue(val interface{}) string
GetAstStringValue returns string value of ast.StringValue object
func GetError ¶
GetError to create error -- Since Error is not implemented for trigger, error code is not built
func GetInterfaceOrUnionType ¶
GetInterfaceOrUnionType returns the interface or union type from a given Output type
func GetMessage ¶
GetMessage to get error message
Types ¶
type Factory ¶
type Factory struct { }
Factory for trigger
type HandlerSettings ¶
type HandlerSettings struct { Operation string `md:"operation,required,allowed(Query,Mutation)"` // GraphQL Operation to be performed ResolverFor string `md:"resolverFor,required"` // Field name from selected operation }
HandlerSettings for trigger
type Output ¶
type Output struct {
Arguments map[string]interface{} `md:"arguments"` // The input arguments to the field of the operation
}
Output of the trigger -- Input into the flow
type Reply ¶
type Reply struct {
Data map[string]interface{} `md:"data"` // The data to reply with
}
Reply from the trigger
type RequestOptions ¶
type RequestOptions struct { Query string `json:"query" url:"query" schema:"query"` Variables map[string]interface{} `json:"variables" url:"variables" schema:"variables"` OperationName string `json:"operationName" url:"operationName" schema:"operationName"` }
RequestOptions struct for graphql request
type Server ¶
Server the server structure
func NewServer ¶
NewServer create a new server instance param server - is a instance of http.Server, can be nil and a default one will be created
func (*Server) IsStarted ¶
IsStarted checks if the server is started will return true even if the server is stopped but there are still some requests to finish
type Settings ¶
type Settings struct { Port int `md:"port,required"` // The port to listen on for requests Path string `md:"path,required"` // The HTTP resource path SecureConnection bool `md:"secureConnection,required"` // Set to "true" for a secure connection ServerKey string `md:"serverKey"` // A PEM encoded private key file CACertificate string `md:"caCertificate"` // A PEM encoded CA or Server certificate file GraphQLSchema string `md:"graphqlSchema,required"` // The GraphQL schema for the trigger }
Settings for trigger
type Trigger ¶
type Trigger struct {
// contains filtered or unexported fields
}
Trigger is a stub for the GraphQLTrigger implementation
func (*Trigger) Initialize ¶
func (t *Trigger) Initialize(ctx trigger.InitContext) error
Initialize trigger