Releases: hasura/ndc-http
Releases · hasura/ndc-http
v0.2.0
Highlights
Distributed execution
Imagine that your backend have many server replications, or multiple applications with different credentials. You want to:
- Specify the server where the request will be executed to.
- Execute an operation to all servers.
For example, with below server settings, the connector will replicate existing operations with Distributed
suffixes:
settings:
servers:
- id: dog
url: "http://localhost:3000"
securitySchemes:
api_key:
type: apiKey
value: "dog-secret"
in: header
name: api_key
- id: cat
url: "http://localhost:3001"
securitySchemes:
api_key:
type: apiKey
value: "cat-secret"
in: header
name: api_key
{
"functions": [
{
"arguments": {
"restOptions": {
"type": {
"type": "nullable",
"underlying_type": {
"name": "RestSingleOptions",
"type": "named"
}
}
}
},
"name": "findPets",
"result_type": {
"element_type": {
"name": "Pet",
"type": "named"
},
"type": "array"
}
},
{
"arguments": {
"restOptions": {
"type": {
"type": "nullable",
"underlying_type": {
"name": "RestDistributedOptions",
"type": "named"
}
}
}
},
"name": "findPetsDistributed",
"result_type": {
"name": "FindPetsDistributedResult",
"type": "named"
}
}
]
}
RestSingleOptions
object type is added to existing operations (findPets). API consumers can specify the server to be executed. If you want to execute all remote servers in sequence or parallel, findPetsDistributed
function should be used.
Config schema changes
Reuse the config schema of ndc-rest-schema. There is a breaking change in the field name path
-> file
.
What's Changed
- Support distributed execution strategies by @hgiasac in #11
- Upgrade ndc-rest-schema v0.2.0 and NDC spec v0.1.3 by @hgiasac in #11
- Improve parameter decoding and
application/x-www-form-urlencoded
content type by @hgiasac in #11
Full Changelog: v0.1.3...v0.2.0