You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "fjtirado (via GitHub)" <gi...@apache.org> on 2024/07/31 14:47:46 UTC
Re: [I] Add GraphQL operation type [incubator-kie-issues]
fjtirado commented on issue #1093:
URL: https://github.com/apache/incubator-kie-issues/issues/1093#issuecomment-2260700412
After careful reviewing the specification, I do not think it makes sense to implement it.
The specification, as written in 0.8, force a user that is already fluent with graphql and probably knows which query he should invoke to split it into three different parts (the operation, where he specifies operation type and schema type; the function ref argument, where he specifies the filter part of the query; and the function ref selection set, which contains the selection part of the query ), just for the implementation to rebuild the query from that information.
I think it will be easier for this kind of graphql fluent user to directly use custom rest [functions](https://sonataflow.org/serverlessworkflow/main/core/custom-functions-support.html#con-func-rest)
This [spec example](https://github.com/serverlessworkflow/specification/blob/0.8.x/specification.md#invoking-a-graphql-query) can be modelled in the following way.
In the workflow definition, user has to defines the graphql rest function (with the path to the graphql endpoint and post as method)
```
"functions": [
{
"name": "graphQLQuery",
"type": "custom",
"operation": "rest:post:/pets/graphql"
}
]
```
and the graphql function invocation (passing the graphql query he wish)
```
{
"name": "getPetId41",
"functionRef": {
"refName": "graphQLQuery",
"arguments": {
"query" : " { pet (id: 41) { id name favoriteTread { id } }}"
}
}
}
```
In application properties he will define the graphql host
`kogito.sw.functions.graphQLQuery.host=https://example.com`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org