All Projects → ryancharris → use-fauna

ryancharris / use-fauna

Licence: other
React hooks for interacting with Fauna databases

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to use-fauna

fauna-workers
A template for building fast, globally distributed applications using Cloudflare Workers and Fauna, the data API for modern applications.
Stars: ✭ 35 (-20.45%)
Mutual labels:  faunadb, fauna
fauna-gql-upload
A tool for managing your FaunaDB database using files. Create resources such as functions by simply creating a new file.
Stars: ✭ 45 (+2.27%)
Mutual labels:  faunadb, fauna
coderplex-org
Official Website for Coderplex Community. Built with Next.js and deployed on Vercel.
Stars: ✭ 32 (-27.27%)
Mutual labels:  faunadb, fauna
faunadb-csharp
C# driver for FaunaDB
Stars: ✭ 55 (+25%)
Mutual labels:  faunadb, fauna
faunadb-ruby
Ruby driver for FaunaDB
Stars: ✭ 37 (-15.91%)
Mutual labels:  faunadb, fauna
fauna-gatsby-comments
Roll your own comments with Gatsby and FaunaDB 🗞️
Stars: ✭ 29 (-34.09%)
Mutual labels:  faunadb, fauna
shopnote
shopnote is a JAMstack application that helps in creating notes with shopping items. This application is built to showcase the JAMstack concept using Fauna, Netlify Serverless Functions and GatsbyJS.
Stars: ✭ 15 (-65.91%)
Mutual labels:  faunadb, fauna
faunadb-http-dart
A pure Dart implementation of a FaunaDB client and provides query classes that closely mimic FQL functions.
Stars: ✭ 28 (-36.36%)
Mutual labels:  faunadb
faugra
A micro "no-backend" backend framework 🤯 Quickly build powerful BaaS using only your graphql schemas
Stars: ✭ 44 (+0%)
Mutual labels:  faunadb
theodorusclarence.com
💠 Personal website and blog made using Next.js, TypeScript, Tailwind CSS, MDX Bundler, FaunaDB, and Preact.
Stars: ✭ 205 (+365.91%)
Mutual labels:  faunadb
netlify-faunadb-graphql-auth
Netlify functions example with faunadb, graphql, and authorization
Stars: ✭ 57 (+29.55%)
Mutual labels:  faunadb
next-fauna-auth
Implemented cookie-based user authentication in a Next.js, FaunaDB and GraphQL app
Stars: ✭ 29 (-34.09%)
Mutual labels:  faunadb
virtual-lolly
JAMstack demo site - prerendered with serverless API fallbacks
Stars: ✭ 110 (+150%)
Mutual labels:  faunadb
GeoNature-atlas
Application WEB permettant de générer des fiches espèces publiques à partir d'observations faune/flore
Stars: ✭ 40 (-9.09%)
Mutual labels:  fauna
testimonial
Jamstack app using Gatsby, Netlify, and FaunaDB.
Stars: ✭ 23 (-47.73%)
Mutual labels:  faunadb
faunadb-importer
Importer tool to load data into FaunaDB
Stars: ✭ 33 (-25%)
Mutual labels:  faunadb
GeoNature
Application de saisie et de synthèse des observations faune et flore
Stars: ✭ 81 (+84.09%)
Mutual labels:  fauna
local-docker-db
A bunch o' Docker Compose files used to quickly spin up local databases.
Stars: ✭ 251 (+470.45%)
Mutual labels:  faunadb
auth-email
🔐 Lightweight authentication specifically designed for Next.js
Stars: ✭ 73 (+65.91%)
Mutual labels:  faunadb
faunadb-fql-lib
No description or website provided.
Stars: ✭ 83 (+88.64%)
Mutual labels:  faunadb

use-fauna

React hooks for FaunaDB

Install

  1. Install the package
npm install --save use-fauna
  1. Import the library
import {
    useFaunaClient,
    useGet,
    useGetAll,
    useCreate,
    useDelete,
    useUpdate
} from 'use-fauna'

Included hooks

useFaunaClient

Instantiate a Fauna client passing this hook an admin key.

const client = useFaunaClient('ADMIN_KEY')

useGetAll

Get all the Collections, Databases, Documents, Functions or Indexes.

const client = useFaunaClient('ADMIN_KEY')
const [getAllFunction, data, status] = useGetAll(client)

getAllFunction('collections')
getAllFunction('databases')
getAllFunction('documents', 'my-collection')
getAllFunction('functions')
getAllFunction('indexes')

useGet

Get an individual Collection, Database, Document, Function or Index.

const client = useFaunaClient('ADMIN_KEY')
const [getFunction, data, status] = useGet(client)

getFunction('collection', 'my-collection')
getFunction('database', 'my-database')
getFunction('document', 'my-collection', 'REF_ID')
getFunction('function', 'my-function')
getFunction('index', 'my-index')

useCreate

Create a Collection, Database, Document or Index.

const client = useFaunaClient('ADMIN_KEY')
const [createFunction, data, status] = useCreate(client)

createFunction('collection', dataObject)
createFunction('database', dataObject)
createFunction('document', dataObject, 'my-collection')
createFunction('function', dataObject)
createFunction('index', dataObject)

useDelete

Delete a Collection, Database, Document or Index.

const client = useFaunaClient('ADMIN_KEY')
const [deleteFunction, data, status] = useDelete(client)

deleteFunction('collection', 'my-collection')
deleteFunction('database', 'my-database')
deleteFunction('document', 'my-collection', 'REF_ID')
deleteFunction('function', 'my-function')
deleteFunction('index', 'my-index')

useUpdate

Update a Collection, Database, Document, Function, Index or Role.

const client = useFaunaClient('ADMIN_KEY')
const [updateFunction, data, status] = useUpdate(client)

updateFunction('collection', 'my-collection', dataObject)
updateFunction('database', 'my-database', dataObject)
updateFunction('document', 'my-collection', dataObject, 'REF_ID')
updateFunction('function', 'my-function', dataObject)
updateFunction('index', 'my-index', dataObject)

This hook is created using create-react-hook.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].