Releases: hasura/ndc-http
v0.7.0
Highlights
The connector can be used as an HTTP proxy. You can send schemaless HTTP requests through the sendHttpRequest
operation. The operation supports timeout and retry options.
mutation SendRawRequest($additionalHeaders: JSON) {
sendHttpRequest(
body: { id: 101, title: "Hello world", userId: 10, body: "A test post" }
method: "post"
url: "https://jsonplaceholder.typicode.com/posts"
additionalHeaders: $additionalHeaders
)
}
# Variables
# {
# "additionalHeaders": {
# "X-Test-Header": "bar"
# }
# }
# Response
# {
# "data": {
# "sendHttpRequest": {
# "body": "A test post",
# "id": 101,
# "title": "Hello world",
# "userId": 10
# }
# }
# }
The request body is encoded with application/json
content type by default. If you add the Content-Type
header in the additionalHeaders
argument the connector will try to convert the request body object to the corresponding format.
What's Changed
- Fix missing scalar type alias from primitive scalars. (#43)
- Add the
Accept
request header with the value from the response content type. (#43) - Decode the response in JSON/XML format if the content type contains
+json
or+xml
suffix. (#43) - Mask sensitive headers that are forwarded from the v3-engine. (#43)
- Fix incorrectly encoding Arbitrary JSON scalar for
application/x-www-form-urlencoded
content type. (#44) - Fix argument preset initialization in server settings. (#44)
- Disable HTML escape when encoding JSON. (#44)
- Reroute HTTP 4xx response from the remote request to HTTP 422 so the detail can appear in the graphql error. (#44)
- feat: add sendHttpRequest mutation to send schemaless HTTP requests by @hgiasac in #45
Full Changelog: v0.6.1...v0.7.0
v0.6.1
What's Changed
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Highlight
Support argument presets to inject values into request arguments. Preset arguments can be configured globally in the root settings
field or on individual servers.
{
"settings": {
"servers": [
{
"url": {
"env": "PET_STORE_URL"
},
"argumentPresets": [
{
"path": "body.name",
"value": {
"type": "env",
"name": "PET_NAME"
},
"targets": ["addPet"]
}
]
}
],
"argumentPresets": [
{
"path": "status",
"value": {
"type": "forwardHeader",
"name": "X-Pet-Status"
},
"targets": ["findPetsByStatus"]
},
{
"path": "body.id",
"value": {
"type": "literal",
"value": 1
},
"targets": ["addPet"]
}
]
}
}
Support 3 value types:
- Literal value
- Environment variable
- Header forwarding
What's Changed
- enhancement: evaluate and convert response types by @hgiasac in #37
- misc: restructure content type encoder modules by @hgiasac in #38
- feat: argument presets by @hgiasac in #39
- fix: duplicated input files and improve validation by @hgiasac in #40
Full Changelog: v0.5.0...v0.6.0
v0.5.0
v0.4.0
What's Changed
- feat: CLI plugin by @hgiasac in #27
- fix: the jsonschema ref link by @hgiasac in #28
- feat: rename
ndc-rest
tondc-http
by @hgiasac in #29 - fix: OAS conversion and trim special characters by @hgiasac in #30
- feat: revise the security schema by @hgiasac in #31
- feat: support xml content type by @hgiasac in #32
Full Changelog: v0.3.0...v0.4.0
v0.3.0
v0.2.4
v0.2.3
What's Changed
- feat: apply default headers from settings by @hgiasac in #17
- feat: upgrade ndc-rest-schema v0.2.2 by @hgiasac in #18
Full Changelog: v0.2.2...v0.2.3
v0.2.2
v0.2.1
What's Changed
- Upgrade ndc-rest-schema v0.2.1 by @hgiasac in #12
- Deprecate the
convert
command. You should install and usendc-rest-schema
binary directly. - misc: change default config directory to /etc/connector by @hgiasac in #13
- fix: avoid modifying mutable request endpoints by @hgiasac in #14
Full Changelog: v0.2.0...v0.2.1