Add Mutations



In this video we show you how to use a custom mutation to you add records to a table in your database.
 
 
--- LINKS ---
 
Free Community Edition Download
 
Alpha Software YouTube Channel
 
Documentation
 
 
 
 
#mobileapp #app #ui #android #ux #ios #mobileappdevelopment #appdesign #uidesign #mobileapps #appdevelopment #uxdesign #mobileappdesign #mobileapplication #userinterface

Transcript

in a previous video we showed how you

can use the update custom mutation to

update data in a record in your sequel

database in this video we're going to

show how you can use a mutation to add a

new record

to a table so we'll start out by looking

at the existing records in say the

categories table so we'll go there and

we'll say get many categories and we can

see that currently there are eight

records in the categories table so let's

go ahead now and add a new record to the

categories table so we'll need to use

the mutation so we'll go mutation and

then we'll go here and type in add and

we want category and then we need to

specify the fields that we would like to

set in this query so you can see here

we're going to go here and we're not

going to specify the category ID field

because that's an order increment we're

going to specify the category name which

we'll just specify as new category and

then we're going to return after this

query executes we're going to return

certain columns from that new record so

we'd like to return the the customer ID

field so we'll go there the category ID

field sorry

and also the category name field so

let's go ahead there and execute that

now

I can see we've got a syntax error so

let's go here and put this in quotes and

you can see now we've added our new rare

chord and the return value here shows

that the new record has an ID of nine

and there's the name that we that we

added so to confirm that this new record

is there let's go ahead and go to our

history here and execute the get many

categories query again so we'll go there

and run this now and you can see now he

has our list of categories and

previously there were eight categories

now there's nine categories and there's

the ninth category with an idea of nine

and a name of new category