Resolver Function
Learn how to create a resolver function and how to return data from mutations.
We'll cover the following...
We'll cover the following...
Building the resolver
Let’s build the resolver function. It will grab the :input argument for us, and then call a general-purpose PlateSlate.Menu.create_item/1 unction that will handle persisting the record:
Here’s how we’ve implemented PlateSlate.Menu.create_item/1:
The actual persistence of the menu items is straightforward, but requires us to know a little about how Ecto works. The important thing to know here is that an Ecto changeset ...