You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Query {
getUser(id:Int):UserUnion
}
union UserUnion = User | CustomError
type CustomError{
code: String
message: String
}
type User{
id:Int
name:String
}
connecting a REST data source to getUser doesn't resolve correctly on response.
Response from upstream:
correct from debug logs: /data (afterFetchHook.OnData): {“user”:{“id”:1,“name”:“Bob”,“status”:“PENDING”,“accessories”:[“A”,“B”,“C”]}}
error from debug logs: /data (afterFetchHook.OnData): {“error”:{“code”:“ERR_01”,“message”:“some error”}}
Actual behavior
After running a query this is the response:
Expected behavior
Response should contain data parsed from the upstream.
The text was updated successfully, but these errors were encountered:
Branch/Environment/Version
Describe the bug
In case union is defined as the result of a UDG query operation with REST data sources, even though all data comes back from the upstream, the response doesn't resolve.
Described as well in community forum: https://community.tyk.io/t/using-union-on-tyk-udg-with-rest-datasource/6296
Reproduction steps
With the following schema:
connecting a REST data source to
getUser
doesn't resolve correctly on response.Response from upstream:
Actual behavior
After running a query this is the response:
Expected behavior
Response should contain data parsed from the upstream.
The text was updated successfully, but these errors were encountered: