Tutorial

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

  1. Packages
  2. PlaceOrder becomes a mutation
  3. The catalogue and the orders become queries
  4. Serve the schema
  5. Ask it
  6. Test it

SDK Reference

AddTraxGraphQL | TraxMutation | Query models | Run progress | AddJunctionEvents | dispatch mutations


Next: 7.1 Packages