Created
September 11, 2019 05:56
-
-
Save mugan86/27b5adaee2c5efe9310c7f7dd25b3c15 to your computer and use it in GitHub Desktop.
queries/axios.js para obtener info de API GraphQL
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
const axios_ = require('axios'); | |
const apiUrl = require('./../constants').apiUrl; | |
const queries = require('./../constants').queries; | |
axios_.post(apiUrl, { | |
query: queries.getCharacters | |
}) | |
.then((res) => { | |
console.log('--------------------- Lista de Personajes --------------------------') | |
console.log(res.data) | |
}) | |
.catch((error) => { | |
console.error(error) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment