update docs and scripts

This commit is contained in:
DavidWells 2018-06-29 16:31:24 -07:00
parent 2aeba61e73
commit a06ffff107
8 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,4 @@
/* Import faunaDB sdk */
import faunadb from 'faunadb'
const q = faunadb.query
@ -8,7 +9,11 @@ const client = new faunadb.Client({
exports.handler = (event, context, callback) => {
const data = JSON.parse(event.body)
console.log("Function `todo-create` invoked", data)
return client.query(q.Create(q.Ref("classes/todos"), {data}))
const todoItem = {
data: data
}
/* construct the fauna query */
return client.query(q.Create(q.Ref("classes/todos"), todoItem))
.then((response) => {
console.log("success", response)
return callback(null, {

View file

@ -1,3 +1,4 @@
/* Import faunaDB sdk */
import faunadb from 'faunadb'
import getId from './utils/getId'

View file

@ -1,3 +1,4 @@
/* Import faunaDB sdk */
import faunadb from 'faunadb'
import getId from './utils/getId'

View file

@ -1,3 +1,4 @@
/* Import faunaDB sdk */
import faunadb from 'faunadb'
const q = faunadb.query

View file

@ -1,3 +1,4 @@
/* Import faunaDB sdk */
import faunadb from 'faunadb'
import getId from './utils/getId'

View file

@ -1,3 +1,4 @@
/* Import faunaDB sdk */
import faunadb from 'faunadb'
import getId from './utils/getId'