- A Next.js Guestbook app with Fauna backend using GraphQL, boilerplate code from Vercel
- Note: to open web links in a new window use: ctrl+click on link
npm run dev
runs the app in the development mode. Open http://localhost:3000 to view it in the browser. Note: requires Fauna API key
npm run build
builds the app for production to the build
folder. Note: requests Fauna API key
npm run start
to run the built app.
๐ป Code Examples - taken from Vercel boilerplate code
lib/fauna.js
mutation function to create a new guestbook entry
export const createGuestbookEntry = (newEntry) => {
const mutation = gql`
mutation CreateGuestbookEntry($input: GuestbookEntryInput!) {
createGuestbookEntry(data: $input) {
_id
_ts
name
message
createdAt
}
}
`
return graphQLClient.request(mutation, { input: newEntry })
}
- Status: Working. Deployed to Vercel
- To-Do: Add extra fields and a user image/icon. Need Fauna API key to run dev. server