Building an Action
The first thing weâll need is a simple way to list all the menu items that we have in our system so that we can then take further action upon them. If you arenât super familiar with doing server-side rendering with Phoenix, donât worry; weâll cover everything you need to know here. In order to avoid writing a ton of HTML boilerplate, weâll use one of the Phoenix generators and then weâll replace the generated controller contents as needed. Run this in your shell:
â | â$ ââmixââ ââphx.gen.htmlââ ââ--no-contextââ ââ--no-schemaââ ââMenuââ ââItemââ ââitemsâ |
â | â$ âârmââ ââtest/plate_slate_web/controllers/item_controller_test.exsâ |
The first command ...
Get Craft GraphQL APIs in Elixir with Absinthe now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.