Project to practice and learn GraphQL concepts


Demo 👉 https://graphql-timeline-api.herokuapp.com/playground

What are we using?

  • Apollo Server
  • GraphQL
  • MongoDB with Mongoose

Getting Started

# clone repo
$ git clone https://github.com/gabrielferreiraa/timeline-graphql-api.git
$ cd timeline-graphql-api

# install dependencies
$ yarn

# start project
$ yarn start

See graphql interface on localhost link: http://localhost:9000/playground


TODO 📝

  • UpdatePost - mutation
  • DeletePost - mutation
  • DeleteUser - mutation
  • getPostById - query
  • GraphQL improviments
  • add tests

Queries 🔎

Simple documentation to see query structures

getAllUsers

query {
    getAllUsers {
        id
        name
        email
    }
}

getUserByEmail

query {
    getUserByEmail(
        email: "[email protected]"
    ) {
        id
        name
        email
    }
}

getAllPosts

query {
    getAllPosts {
        id
        title
        content
        user {
            name
            email
        }
    }
}

Mutations ✏️

Simple documentation to see mutation structures

Auth

mutation {
    Auth(
        email: "[email protected]"
        password: "1234"
    ) {
        token
        error
    }
}

CreateUser

mutation {
    CreateUser(
        name: "Raul Gil",
        email: "[email protected]",
        password: "1234"
    ) {
        id
        name
        email
    }
}

UpdateUser

mutation {
    UpdateUser(
        name: "Raul Gil - Edited",
        email: "[email protected]"
    ) {
        name
        email
    }
}

CreatePost

mutation {
    CreatePost(
        title: "Post Title"
        content: "Post Content"
    ) {
        title
        content
        user {
            name
            email
        }
    }
}

License

MIT

Apollogram Server

Timeline API to practice and learn GraphQL concepts using Apollo Server, MongoDB and Typescript

Apollogram Server Info

⭐ Stars11
🔗 Source Codegithub.com
🕒 Last Update2 years ago
🕒 Created3 years ago
🐞 Open Issues21
➗ Star-Issue Ratio1
😎 Authorgabrielferreiraa