November 18, 2019

MVP complete

Jamie Barton @notrab

A week had gone by and I spent the little time I had on evenings hacking together the MVP so I could show some friends.

There is now a fully functioning API that's built on MongoDB Atlas, hosted with Zeit and available via GraphQL.

I ended up building the following mutations for simpler cart management;

  • addItem (add individual cart items)
  • setItems (set all items in bulk)
  • updateItem (update a single cart item by id)
  • removeItem (remove cart item by id)

There wasn't a concept of creating or updating a cart by this point, each mutation returned the current state of the cart, providing you gave it a unique ID.

I spent a few more evenings adding some very simple mutations and a query to get (or create) a cart by ID.

There are now handy mutations to increment/decrement item quantities, empty cart and delete the cart entirely.

Overall there is about 1000 lines of code to build the project. I'm fairly pleased with the outcome.

Loading comments...