Skip to content

raeldev/GraphQL_Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphql_Example

Just to example how Graphql works.

Prerequisites

1 - NodeJS

2 - Yarn or another package manager

Getting Started

1 - Go to project after clone 2 - Run "yanr install" to install all dependencies or install "graphql-yoga" from your package manager.

yanr install

3 - Run "node .\src\server.js" (my case, Windows 10)

node .\src\server.js

4 - Open playground in browser http://localhost:4000 and feel the magic.

5 - Query Example (Always use POST):

{
    query users {
        users ({ 
            per_page: 20, 
            page: 2, 
            filter: {
                nome: { "starts_with": "Israel" }
            }
        })
        {
            id,
            name
            groups {
                id
            }
        }
    }
}

6 - Mutation Example:

{
    mutation updateUser {
        updateUser(id: 1) {
            email: "[email protected]" 
        }
    }
}

Built With

About

NodeJS example for GraphQL Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published