Skip to content

Commit 2a89338

Browse files
committed
add graphql supp
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
1 parent b142fc5 commit 2a89338

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

api/src/main/java/io/serverlessworkflow/api/deserializers/FunctionRefDeserializer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public FunctionRef deserialize(JsonParser jp,
6767
functionRef.setRefName(node.get("refName").asText());
6868
}
6969

70+
if (node.get("selectionSet") != null) {
71+
functionRef.setSelectionSet(node.get("selectionSet").asText());
72+
}
73+
7074
return functionRef;
7175
}
7276
}

api/src/main/java/io/serverlessworkflow/api/serializers/FunctionRefSerializer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public void serialize(FunctionRef functionRef,
3939

4040
if (functionRef != null) {
4141
if ((functionRef.getArguments() == null || functionRef.getArguments().isEmpty())
42+
&& (functionRef.getSelectionSet() == null || functionRef.getSelectionSet().isEmpty())
4243
&& functionRef.getRefName() != null
4344
&& functionRef.getRefName().length() > 0) {
4445
gen.writeString(functionRef.getRefName());
@@ -53,6 +54,10 @@ public void serialize(FunctionRef functionRef,
5354
gen.writeObjectField("arguments", functionRef.getArguments());
5455
}
5556

57+
if (functionRef.getSelectionSet() != null && functionRef.getSelectionSet().length() > 0) {
58+
gen.writeStringField("selectionSet", functionRef.getSelectionSet());
59+
}
60+
5661
gen.writeEndObject();
5762
}
5863
}

api/src/main/resources/schema/functions/functiondef.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"enum": [
1919
"rest",
2020
"rpc",
21+
"graphql",
2122
"expression"
2223
],
2324
"default": "rest"

api/src/main/resources/schema/functions/functionref.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"type": "object",
1212
"description": "Function arguments",
1313
"existingJavaType": "com.fasterxml.jackson.databind.JsonNode"
14+
},
15+
"selectionSet": {
16+
"type": "string",
17+
"description": "Only used if function type is 'graphql'. A string containing a valid GraphQL selection set"
1418
}
1519
},
1620
"required": [

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy