- Updated to support v0.2.0 of the NDC Spec. This is a very large update which adds new features and some breaking changes.
- If the
X-Hasura-NDC-Version
header is sent, the SDK will validate that the connector supports the incoming request's version and reject it if it does not. If no header is sent, no action is taken.
- Added support for exporting OpenTelemetry traces and metrics over GRPC. A new environment variable
OTEL_EXPORTER_OTLP_PROTOCOL
lets you switch betweenhttp/protobuf
andgrpc
.- Breaking change: the default OpenTelemetry exporter has changed from
http/protobuf
sending tohttp://localhost:4318
togrpc
sending tohttp://localhost:4317
. To return to the old defaults, set the following environment variables:OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
- Breaking change: the default OpenTelemetry exporter has changed from
- Updated to support v0.1.6 of the NDC Spec (#37)
- Support for querying nested collections inside an EXISTS expression in a predicate
Breaking changes (#36):
Connector.healthCheck
has been removed and replaced withConnector.getHealthReadiness
, which only returns whether the connector is able to accept requests, not whether any underlying connections to data sources actually work.- The
/health
endpoint is now unauthorized, allowing healthchecks to be performed without authorization. Connector.getCapabilities
now returnsCapabilities
instead ofCapabilitiesResponse
. The SDK will now take care of adding the correct NDC version to theCapabilities
on behalf of the connector.
- The connector now listens on both ipv4 and ipv6 interfaces by default. This can be configured by using the
HASURA_CONNECTOR_HOST
environment variable, which sets the host the web server listens on. (#34) - Updated to support v0.1.5 of the NDC Spec (#35)
- There are no real changes in this version; it is a version number-only change
- Updated to support v0.1.4 of the NDC Spec (#33)
- Support for aggregates over nested fields
- Updated to support v0.1.3 of the NDC Spec (#32)
- Breaking change: new
nested_fields
property onQueryCapabilities
; set it to{}
to retain previous v0.1.2 semantics and not support new v0.1.3 capabilities. - Support field arguments
- Support filtering and ordering by nested fields
- Added a
biginteger
type representation
- Breaking change: new
- Use
prom-client
to implement the metrics endpoint (#29) - Allow any error code in custom HTTP responses (#30)
- Updated to support v0.1.2 of the NDC Spec
- More precise type representations of scalar types were added and the general numeric ones were deprecated (
number
andinteger
)
- More precise type representations of scalar types were added and the general numeric ones were deprecated (
- Updated to support v0.1.1 of the NDC Spec
- A more precise definition of equality operators
- Scalar types can now specify a representation, including an enum representation
- Add
main
andtypes
properties to thepackage.json
to enablenode10
module resolution to be used by projects using legacy TypeScript compiler settings
- OpenTelemetry spans are now attributed with
internal.visibility: "user"
so that they show up in the Hasura Console @hasura/ndc-sdk-typescript/instrumentation
now exportswithActiveSpan
to wrap a span around a function andwithInternalActiveSpan
which does the same but without theinternal.visibility: "user"
attribute.- Automatic OpenTelemetry instrumentation for fetch requests has been added
- Add OpenTelemetry support
- Set env var
OTEL_EXPORTER_OTLP_ENDPOINT
to the endpoint to send OpenTelemetry to OTEL_SERVICE_NAME
overrides the service name- Command line arguments
--otlp-endpoint
and--service-name
have been removed in favour of the environment variables - Import
@hasura/ndc-sdk-typescript/instrumentation
to useinitTelemetry
to initialize OpenTelemetry earlier in your startup, if necessary
- Set env var
- Add OpenTelemetry support
- Set env var
OTEL_EXPORTER_OTLP_ENDPOINT
to the endpoint to send OpenTelemetry to OTEL_SERVICE_NAME
overrides the service name- Command line arguments
--otlp_endpoint
and--service-name
have been removed in favour of the environment variables - Import
@hasura/ndc-sdk-typescript/instrumentation
to useinitTelemetry
to initialize OpenTelemetry earlier in your startup, if necessary
- Set env var
Breaking change: support for the Connector Deployment Spec.
- The connector configuration server has been removed
- The way configuration is handled on
Connector
interface has changedgetRawConfigurationSchema
,makeEmptyConfiguration
,updateConfiguration
have been removed.parseConfiguation
replacesvalidateRawConfiguration
, and is given the directory path in which the connector's configuration files can be found- The
RawConfiguration
type parameter has been removed
- The default port has changed from 8100 to 8080
- The command line arguments passed to the
serve
command have changed:- The
--configuration
argument now takes the connector's configuration directory. Its associated environment variable is nowHASURA_CONFIGURATION_DIRECTORY
- The
--otlp_endpoint
argument has been renamed to--otlp-endpoint
and its environment variable is nowOTEL_EXPORTER_OTLP_ENDPOINT
- The
PORT
environment variable has changed toHASURA_CONNECTOR_PORT
- The
SERVICE_TOKEN_SECRET
environment variable has changed toHASURA_SERVICE_TOKEN_SECRET
- The
LOG_LEVEL
environment variable has changed toHASURA_LOG_LEVEL
- The
PRETTY_PRINT_LOGS
environment variable has changed toHASURA_PRETTY_PRINT_LOGS
- The
Breaking change: support for the v0.1.0-rc.15 of NDC Spec.
- The mutation request/response format has changed.
MutationOperation
fields are now defined as aNestedField
MutationOperationResponse
now returns a single value rather than a rowset
Breaking change: support for the v0.1.0-rc.14 of NDC Spec.
- Function name formatting is now standard JavaScript
camelCase
. NDC types used for wire-transmission match the spec (snake_cased). - Added nested field selections (
Field.fields
) - Capabilities now only specifies a single supported version (
CapabilitiesResponse.version
) Expression.where
renamed toExpression.predicate
PathElement.predicate
is now optional- Added Predicate types (new
predicate
Type.type) - Added mutation capability
- Comparison operators
- Changes to explain:
Connector.explain
renamed toConnector.queryExplain
and endpoint moved from/explain
to/query/explain
.Connector.mutationExplain
added with endpoint/mutation/explain
.explain
capability moved toquery.explain
.mutation.explain
capability added.
ComparisonOperatorDefinition
now hasequal
andin
as two standard definitions and custom operators can be defined. The equality operator is no longer required to be defined and must be explicitly defined.
- Add new
ConnectorError
types:UnprocessableContent
: The request could not be handled because, while the request was well-formed, it was not semantically correct. For example, a value for a custom scalar type was provided, but with an incorrect typeBadGateway
: The request could not be handled because an upstream service was unavailable or returned an unexpected response, e.g., a connection to a database server failed
- Generate TypeScript declaration maps for better "go to definition" tooling
get_serve_command
andget_serve_configuration_command
now support creation without automatically starting servers. This allows usage in scenarios where a customized server startup is desired.
- added auth hook using secret token