Tutorial

15.8 Keep it current

The client is generated from the hub, so any change to a train, a query model, a machine or a document means exporting and generating again. Forgetting to is caught in CI: --check writes nothing and fails, naming each file, when what is committed is not what the manifest generates.

dotnet run --project Shopfront.Hub -- --trax-export-client ../web/src/trax/manifest.json
cd web
dotnet trax client --manifest src/trax/manifest.json --out src/trax --documents 'src/graphql/*.graphql' --check
The client in /home/you/Shopfront/web/src/trax is what the manifest generates.

Deploy the hub before the storefront: a page whose documents the hub has not registered yet is refused.

SDK Reference

Generated clients | trax client | Client manifest | Fetch only what a component needs | Run progress


Next: 15.9 Test it