Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to make graphql request in axios

const data = await axios.post(API_URL, {
  query: `mutation updateUserCity($id: Int!, $city: String!) {
    updateUserCity(userID: $id, city: $city){
      id
      name
      age
      city
      knowledge{
        language
        frameworks
      }
    }
  }`,
  variables: {
    id: 2,
    city: 'Test'
  }
}, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to implement toastr 
Javascript :: sh 1 nodemon not found heroku 
Javascript :: split a string every n characters javascript 
Javascript :: replace non alphanumeric javascript 
Javascript :: react-native-checkbox in a loop 
Javascript :: Codewars Convert a String to a Number! 
Javascript :: javascript click sound 
Javascript :: unrecognized json property java 
Javascript :: Convert underscore strings to camel Case 
Javascript :: jquery sum all input values 
Javascript :: javascript generate a random number between two numbers thats not 1 
Javascript :: Error: Error: Could not resolve [object Object] / undefined at Scope.resolve 
Javascript :: jquery destroy element 
Javascript :: jquery get height of element 
Javascript :: javascript wait 10 seconds 
Javascript :: gdscript add child node 
Javascript :: javascript search like 
Javascript :: install aos in react 
Javascript :: setlocalstorage 
Javascript :: js onchange paramteter sring 
Javascript :: current height minus px 
Javascript :: capitalize in javascript 
Javascript :: javascript loop through object example 
Javascript :: show div with jquery 
Javascript :: js upload file dialog 
Javascript :: ignore node_modules 
Javascript :: regex for yyyy-mm-dd 
Javascript :: useHistory goback 
Javascript :: scroll back to top on every transition in react 
Javascript :: set an attribute background image javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =