Created
February 10, 2018 22:03
-
-
Save steniowagner/c2053636939cdebe6f39b95d14a9c1ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adicionando um user, isso é equivalente a um POST do REST | |
mutation { | |
addUser (userid:"24", name:"joao victor", age: 23) { | |
// Esses parâmetros são o que tu quer saber após o POST | |
userid | |
name | |
age | |
} | |
} | |
// Requisitando um usuário com o userid '4', equivalente à um GET do Rest | |
user (userid: "24") { | |
// Só pega os dados que tu quer pegar, nao precisa pegar tudo, diferente do REST | |
name | |
age | |
} | |
// Deletando um usurio, mesma coisa dos outros... | |
mutation { | |
deleteUser (userid: "24") { | |
userid | |
name | |
age | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment