🎁

12 Days of Baddass Courses sale! Get instant access to the entire egghead library of courses and lessons for 58% off.

Runs out in:
05 : 09 : 41 : 03
1×
Become a member
to unlock all features
Autoplay

    Introduction to FaunaDB's GraphQL support

    Chris BiscardiChris Biscardi
    faunadbFaunaDB

    FaunaDB has native support for a GraphQL API backed by FQL. In this video we'll cover the limitations, importing a GraphQL schema, and executing our first mutations and queries.

    graphqltype Todo {
        title: String!
        completed: Boolean
    }
    
    type Query {
        allTodos: [Todo!]
        todosByCompletedFlag(completed: Boolean!): [Todo!]
    }
    graphqlmutation CreateTodo {
      createTodo(data: {
        title: "Finish Video on GraphQL"
      }) {
        _id
        completed
      }
    }
    graphqlmutation CreateTodo {
      createTodo(data: {
        title: "Add Second Todo",
        completed: false
      }) {
        _id
        completed
      }
    }
    graphqlmutation UpdateTodo {
      updateTodo (
        id: "245273222698762765"
        data: {
          title: "A Different Todo",
          completed: false
        }) {
        title
        completed
      }
    }
    graphqlquery AllTodosQuery {
      allTodos {
        data { _id title completed }
      }
    }
    graphqlquery AllTodosQuery {
      todosByCompletedFlag(completed: false) {
        data {
          _id
          title
        }
      }
    }
    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss