score:0

you can also try this code

return fetch(hostname, {
    method: 'post',
    headers: {
      'content-type': 'application/json'
    },
    body: json.stringify({ variables: { input: data}})
  })
  .then((res) => {
    return res.json()
  })
  .then((payload) => {
    return payload
  }).catch((error) => {
    throw error
  })

Related Query

More Query from same tag