Closed benzolium closed 3 months ago
@benzolium Thanks for the report. I've tried to reproduce it using your test but it seems there is a JSON syntax error in the handler
response of serviceC
(notice the spurious comma after "id": "1"
. This is the cause of the invalid character '}'
error message.
"value": {
"_bramble_id": "BAR1",
"_bramble__typename": "BAR",
"id": "1",
}
Oh, my bad. Good catch, @nmaquet. I'll try to reproduce the issue properly cause I'm still getting this error in actual gateway.
Maybe I should catch the issue somewhere else. 🤔
No worries. Can you double check that your downstream service returns syntactically correct JSON? If you're templating your JSON or using string builders it's easy to make a make a mistake and have that extra comma.
@benzolium Any update on this issue? We'd be happy to help if you have some steps to reproduce the problem.
@nmaquet sorry, got lost in work.
I've just tried to test query on downstream service only.
In my case downstream service returns this for value:
"value": {}
So it is syntactically correct JSON.
I have some types, e.g.:
I'm trying to query:
As you can see, I forgot to query
BarFragment on Bar
.Expected:
baz
's value is nullActual:
Internal server error
(error decoding response: invalid character '}' looking for begi nning of object key string
)I've also reproduced it with a test: https://github.com/benzolium/bramble/blob/f3ddc95ce4450327509ea8b258d4bc7889431935/execution_test.go#L696
I could probably fix that, but I don't know where to start.