record-fixtures

command
v1.2.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command record-fixtures captures real GitHub GraphQL responses for a fixed set of accounts/repos and vendors them under tests/fixtures/ as replay fixtures for the layer-2 data tests.

Why record instead of hand-authoring: a hand-written mock body tends to be internally consistent (e.g. followers.totalCount equals len(nodes)), which masks aggregation bugs like #470 where the card must show the true total (59) but the code counts the fetched page (24). A response recorded from the real API carries the genuine asymmetry, so the bug cannot hide.

This tool hits the live API and therefore needs a token; it is NOT run in CI. Re-record intentionally when the upstream query changes or the pinned values need refreshing:

GITHUB_TOKEN=$(gh auth token) go run ./internal/tools/record-fixtures

Each recording POSTs the SAME query file the production code uses (internal/githubapi/queries/<file>) so the fixture matches the wire shape genqlient expects. Note the circularity caveat: a field the active query does not request will be absent from the recording too — layer 1 (query field-presence) guards that separately.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL