Skip to content

Commit 82a7c16

Browse files
authored
add graphql function type and selectionSet to functionRef (#38)
Signed-off-by: mattgarmon <mjg2790@gmail.com>
1 parent 05c78be commit 82a7c16

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

model/function.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const (
2323
FunctionTypeRPC FunctionType = "rpc"
2424
// FunctionTypeExpression ...
2525
FunctionTypeExpression FunctionType = "expression"
26+
// FunctionTypeGraphQL ...
27+
FunctionTypeGraphQL FunctionType = "graphql"
2628
)
2729

2830
// FunctionType ...
@@ -35,7 +37,7 @@ type Function struct {
3537
Name string `json:"name" validate:"required"`
3638
// If type is `rest`, <path_to_openapi_definition>#<operation_id>. If type is `rpc`, <path_to_grpc_proto_file>#<service_name>#<service_method>. If type is `expression`, defines the workflow expression.
3739
Operation string `json:"operation" validate:"required"`
38-
// Defines the function type. Is either `rest`, `rpc` or `expression`. Default is `rest`
40+
// Defines the function type. Is either `rest`, `rpc`, `expression` or `graphql`. Default is `rest`
3941
Type FunctionType `json:"type,omitempty"`
4042
}
4143

@@ -45,6 +47,8 @@ type FunctionRef struct {
4547
RefName string `json:"refName" validate:"required"`
4648
// Function arguments
4749
Arguments map[string]interface{} `json:"arguments,omitempty"`
50+
// String containing a valid GraphQL selection set
51+
SelectionSet string `json:"selectionSet,omitempty"`
4852
}
4953

5054
// UnmarshalJSON ...

0 commit comments

Comments
 (0)