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'
    }
  })

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
send graphql query in axios graphql-request axios graphql request with axios hit graphql api using axios grapthql axios request graphql express api axios axios graphql post send graphql request by axios axios graphql query returns html graphql-request with axios graphql get axios api post in graphql api axios axios for graphql axios grapql graphql query axios how to query graphql api using axios in recatjs axios the graph calls axios get data graphql api graphql get query in axios axios sending queries axios call graphql axios post graphql query axios js graphql post axios graphql request is axios recommended for graphql axios graphl axios graphql request with variables use axios for graphql api how to fetch graphql with axios axios post graphql axios send graphql query simple axios graphql client axios js require graphql file axios grapql post post request graphql axios graphql request axios call graphql axios graph request with axios How to call a GraphQL API with Axios axios graphql request graphql query with axios graphlql client like axios axios get graphql query syntax how to pass graphql query in axios how to use graphql with axios get axios request graphql query graphql id axios axios with graphql graphql through axios graphql get method axios graphql axios get axios get data from server graphql Should I use axios or graphql using axios with graphql axios graphql example react how to axios graph ql axios quqry graph axios call graph axoi query param with grahp ql axio call graph github graphql axios tutorial axios post graphql request with params react axios graphql get request grpahql client qith axios graphql react axios how to use graphql axios send graphql query with axios axios graph ql headers graph ql request with axios axios graphql post example use axios as graphql client axios.get graphql axios with graphql react how to request data from hasura using axios in react apollo graphql with axios apollo client vs axios graphql axios call graquql and axios graphql in axios axios graphsql sending header to graphql with axios how to use graphql with axios how to write a graphql query axios graphql request using axios make a graphql request with axios using axios and graphql Apollo client and axios Axios and graph ql how to use graphql apis with axios react axios and graphql query data from graphql using axios axios query graphql axios graphql apollo axios graphql] axios graphql testing axios get data from graphql axios get graphql graphQl and axios axios post graphql request axios graphql get how to send a post request to graphql react axios make graphql request garphql avec axios axios api.graphql.jobs axios fetch from graphql axios get from graphql axios graphql call apollo vs axios graphql axios request graphql api react js context axios react native axios graphql axios call mutation in apollo client axios graphql react graphql external api axios axios example graphql use axios for graphql call graphql query from react axios make graphql request with axios Apollo with axios how to use axios with graphql axios graphql query axios get request graphql axios get graphql query graphql api call with axios in react-native graphql api call with axios axios graphql with header graphql using axios send request to graphql with axios how to use axios to a graphql call api graphql query using axios apollo client for node acios axios graphql graphql with axios graphql typescript axios how to get with axios in graphql typescript graphql axios axios send graphql parameter axios and graphql call graphql using axios graphql query from axios js acios graphql axios graphql isnot working
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source