v0.5.0
Highlights
Support NDC spec v0.1.2
Support schema for NDC spec v0.1.2 with more representations and reusable scalars:
BigInt
: implementsint64
representation which can encode and decode from number string.Date
: implementsdate
representation which can encode and decode from ISO 8601 date string.
Test Snapshots
The tool supports test snapshots generation for query and mutation requests and responses that are compatible with ndc-test replay command. See generated snapshots at the codegen example.
Usage: hasura-ndc-go test snapshots
Generate test snapshots.
Flags:
-h, --help Show context-sensitive help.
--log-level="info" Log level.
--schema=STRING NDC schema file path. Use either endpoint or schema path
--endpoint=STRING The endpoint of the connector. Use either endpoint or schema path
--dir=STRING The directory of test snapshots.
--depth=10 The selection depth of nested fields in result types.
--query=QUERY,... Specify individual queries to be generated. Separated by commas, or 'all' for all queries
--mutation=MUTATION,... Specify individual mutations to be generated. Separated by commas, or 'all' for all mutations
--strategy="none" Decide the strategy to do when the snapshot file exists. Accept: none, override.
The command accepts either a connector --endpoint
or a JSON --schema
file.
Endpoint
hasura-ndc-go test snapshots --endpoint http://localhost:8080 --dir testdata
NDC Schema
hasura-ndc-go test snapshots --schema schema.generated.json --dir testdata
What's Changed
- feat: add convenience scripts by @hgiasac in #58
- feat: add test snapshots command by @hgiasac in #60
- feat: update NDC Spec v0.1.2 by @hgiasac in #62
- utils: improve value decoder for Boolean and String by @hgiasac in #68
Full Changelog: v0.4.0...v0.5.0