I'm writting an GraphQL query and i have to use $like but i get a Syntax Error: Unexpected from the GraphQl service how can i use $like like a string without having this error ?
i try this :
'funquery(filter:"{\"++ vars.filter++\":{\"$like\":\"++ vars.value ++\"}}") {
#values to get
}'
but this get me an error from the dataweave : Unable to resolve reference of: 'like'. So i try this :
'funquery(filter:"{\"++ vars.filter++\":{\"\$like\":\"++ vars.value ++\"}}") {
#values to get
}'
and with this i got Syntax Error: Unexpected <EOF>
I suspect that you are trying to output a GraphQL query that replaces the values of the variable and leaves them between quotes. If that is the case the quotes are incorrectly balanced in your script. Also GraphQL is not JSON, so using JSON as the output format may break quoting. Try using application/java to return a string with the query:
The output is a string: