Currently, only one resolver at a time is supported on a field. We want to change it to allow multiple resolvers:
DSL Changes
type Query {
data: Data
@http(url: "http://api.com/foo")
@http(url: "http://api.com/bar")
dataList: [Data]
@http(url: "http://api.com/foo")
@http(url: "http://api.com/bar")
}
Runtime Changes
Given multiple resolvers (HTTP gRPC or GraphQL) the expectation is to perform deep merge as follows by creating a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:
and both values are objects, the two values will be recursively merged
otherwise if the value is an array, the two values should be concatenated
otherwise the value from the second object will be used.
Note the select operation should be applied first on the HTTP and only then should it be picked up for merging.
Technical Requirements
Add unit tests for this deep merge algorithm
Add integration tests to check end to end execution flow is implemented correctly.
Currently, only one resolver at a time is supported on a field. We want to change it to allow multiple resolvers:
DSL Changes
Runtime Changes
Given multiple resolvers (HTTP gRPC or GraphQL) the expectation is to perform deep merge as follows by creating a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:
Note the
select
operation should be applied first on the HTTP and only then should it be picked up for merging.Technical Requirements