7. Serve it over GraphQL
Shopfront's API is two hand-written endpoints, and every new thing a client needs would be another.
In this chapter Trax generates the API instead: a GraphQL schema with the catalogue for everyone,
PlaceOrder for customers and each customer's own orders, from the trains and entities that are
already there and the rules already on them. A customer can also follow the run of their order,
junction by junction.
This chapter starts from the end of chapter 6.
In this chapter
- Packages
- PlaceOrder becomes a mutation
- The catalogue and the orders become queries
- Serve the schema
- Ask it
- Test it
SDK Reference
AddTraxGraphQL | TraxMutation | Query models | Run progress | AddJunctionEvents | dispatch mutations
Next: 7.1 Packages