Repository navigation
docs(midnight): update indexer API docs to deployed v4.4 - #474
Merged
Merged
Conversation
The src/paths/midnight files that referenced them are gone, and redocly bundle output is unchanged without them.
- Replace midnight-indexer-api.graphql with the schema deployed by ops (indexer 8036abb, identical to v4.4.0-rc.5) - Mark @beta items in the rendered docs via a docs-only schema copy - Hide the bridgeEvents subscription, which fails on Blockfrost - Fix the transaction fee and shielded subscription examples - Document WebSocket close codes rewritten or sent by the proxy
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unescaped $sid references break the rendered GraphQL example, while incomplete subscription recovery guidance can cause invalid queries or false expectations of replay.
2 open issues
What changed in this PR
Updates Blockfrost’s Midnight API documentation to the deployed indexer v4.4 schema, keeping the downloadable schema unchanged from upstream.
Changes:
- Refreshes the schema with new APIs and deprecations, adds visible beta labels, and hides the unsupported
bridgeEventssubscription from rendered docs. - Updates examples, subscription guidance, WebSocket close codes, and schema-update instructions.
- Removes unused Midnight OpenAPI schemas and integrates schema preprocessing into the documentation build.
| File | Description |
|---|---|
yarn.lock |
Locks the new direct GraphQL dependency. |
src/scripts/midnight-docs-schema.ts |
Adds beta labels and filters unsupported documentation fields. |
src/schemas/midnight/zswap_ledger_event.yaml |
Removes unused Zswap event schema. |
src/schemas/midnight/unshielded_utxo.yaml |
Removes unused unshielded UTXO schema. |
src/schemas/midnight/transaction.yaml |
Removes unused transaction schema. |
src/schemas/midnight/transaction_result.yaml |
Removes unused transaction result schema. |
src/schemas/midnight/transaction_fees.yaml |
Removes unused transaction fee schema. |
src/schemas/midnight/system_parameters.yaml |
Removes unused system parameters schema. |
src/schemas/midnight/graphql_request.yaml |
Removes unused GraphQL request schema. |
src/schemas/midnight/graphql_error.yaml |
Removes unused GraphQL error schema. |
src/schemas/midnight/dust_output.yaml |
Removes unused DUST output schema. |
src/schemas/midnight/dust_ledger_event.yaml |
Removes unused DUST ledger event schema. |
src/schemas/midnight/dust_generation_status.yaml |
Removes unused DUST generation status schema. |
src/schemas/midnight/d_parameter.yaml |
Removes unused D-parameter schema. |
src/schemas/midnight/d_parameter_change.yaml |
Removes unused D-parameter history schema. |
src/schemas/midnight/contract_deploy.yaml |
Removes unused contract deployment schema. |
src/schemas/midnight/contract_balance.yaml |
Removes unused contract balance schema. |
src/schemas/midnight/contract_action.yaml |
Removes unused contract action schema. |
src/schemas/midnight/block.yaml |
Removes unused block schema. |
spectaql.yaml |
Uses the processed schema and updates API guidance and examples. |
README.md |
Documents schema downloading and beta preprocessing. |
package.json |
Integrates preprocessing and adds GraphQL as a dev dependency. |
midnight-indexer-api.graphql |
Updates the source schema to deployed v4.4. |
docs/midnight/midnight-indexer-api.graphql |
Updates the downloadable upstream schema. |
CHANGELOG.md |
Records documentation updates, example fixes, and cleanup. |
Review effort: Balanced
SpectaQL substitutes $name from the environment, so $sid and $offset rendered as empty strings. Escape them as \$. Replace the generic resume advice with each subscription's cursor argument, and note that bridge snapshot subscriptions have none.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The Midnight docs were last updated for indexer 4.0 (
midnight-indexer-api.graphqlwas 1132 lines). Ops master deploys indexer8036abb, whoseschema-v4.graphqlis byte-identical to thev4.4.0-rc.5tag (2558 lines). This updates the docs to match.midnight-indexer-api.graphqlwith the deployed one. Nothing breaks for existing queries. There are 45 new types (bridge, contract events, DUST generations, Merkle tree updates), new queries and subscriptions, and several deprecations (fees→fee,merkleTreeRoot/startIndex/endIndex→zswap*,collapsedMerkleTree→zswapCollapsedUpdate,highest*EndIndex→highest*ZswapEndIndex). SpectaQL already renders the deprecations.@betaitems would have rendered as stable API.src/scripts/midnight-docs-schema.tsruns inbuild:midnight-docs. It writes a docs-only copy of the schema to.cache/spectaql/with a "Beta:" note on each@betaitem. The schema published atdocs/midnight/midnight-indexer-api.graphqlstays identical to upstream.graphqlis added as a devDependency (it was only a transitive dependency of SpectaQL).bridgeEventssubscription hidden: on Blockfrost mainnet and preprod, everybridgeEventssubscription closes with 4006 (the upstream's 1006, rewritten by@fastify/http-proxyin vindler) before sending any event. The script drops it from the docs-only schema, and it isn't mentioned in the prose. The HTTPbridgeEventsquery works and stays documented.fees { paidFees estimatedFees }on theTransactioninterface. It now uses... on RegularTransaction { fee }.sendProgressUpdates,ViewingUpdateandhighestIndex, none of which exist. It is rewritten aroundRelevantTransaction/ShieldedTransactionsProgress.connect(options: { startIndex })and theindexresume argument.contractEvents,dustGenerations,bridgePoolUpdatesandbridgeBalance.Rate limit exceeded) and 1013 (WebSocket send queue exceeded).src/schemas/midnight/*.yaml. Nothing references them sincesrc/paths/midnightwas removed, and theyarn bundleoutput is unchanged without them.Upstream
mainalso addsstateAtonContract/contract actions and aBlockReferencetype. These aren't deployed yet, so they aren't included.Testing
yarn bundle:openapi.yaml,openapi.jsonandblockfrost-openapi.yamlare unchanged.yarn tsc --noEmitis clean andvitestpasses (42/42).midnight-mainnet.blockfrost.io: all 709 type, field, argument and enum signatures match the pinned schema.spectaql.yamlagainst mainnet:blockssubscription works with both header and?project_id=auth.connectwith and withoutoptions.startIndex, the documentedshieldedTransactionsquery returnsShieldedTransactionsProgressevents, thendisconnect.contractActions,dustLedgerEvents,zswapLedgerEvents,bridgePoolUpdatesandbridgeBalanceemit events.toBlock.unshieldedTransactionsanddustGenerations, because no suitable address was found.