Skip to content

Instantly share code, notes, and snippets.

@mugan86
Created September 11, 2019 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mugan86/27b5adaee2c5efe9310c7f7dd25b3c15 to your computer and use it in GitHub Desktop.
Save mugan86/27b5adaee2c5efe9310c7f7dd25b3c15 to your computer and use it in GitHub Desktop.
queries/axios.js para obtener info de API GraphQL
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