Skip to content

add graphql function type and selectionSet to functionRef #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion model/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const (
FunctionTypeRPC FunctionType = "rpc"
// FunctionTypeExpression ...
FunctionTypeExpression FunctionType = "expression"
// FunctionTypeGraphQL ...
FunctionTypeGraphQL FunctionType = "graphql"
)

// FunctionType ...
Expand All @@ -35,7 +37,7 @@ type Function struct {
Name string `json:"name" validate:"required"`
// 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.
Operation string `json:"operation" validate:"required"`
// Defines the function type. Is either `rest`, `rpc` or `expression`. Default is `rest`
// Defines the function type. Is either `rest`, `rpc`, `expression` or `graphql`. Default is `rest`
Type FunctionType `json:"type,omitempty"`
}

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

// UnmarshalJSON ...
Expand Down