I was trying to mutation in graphQL by using Hasura's API console. I checked in Hasura it's properly worked there. But when I was trying to add in react code it gives an error.
Code:
Axios.post("http://domain.herokuapp.com/v1/graphql", {
query: `
mutation createCompanyBusiness {
insert_appcompany(objects: {
fullname: "Company Full Name 344",
contact: "{{\"Tel\", 01}, {Email, email@test.com}}",
billing_floor_flat_house_no: "floor 14, house 6",
last_update_by: 112,
create_by: 112,
privacy: true,
app_property: {
data: {
property_name: "Niketon House",
building_number: "22C",
last_update_by: 122,
create_by: 122,
app_street: {
data: {
street_name:
"Long Street",
district_suburb_county_city: "New City",
town_city: "New Town",
country: "Singapore",
last_update_by: 122,
create_by: 122
}
}
}
}
}) {
returning {
appcompany_id
}
}
}
`,
})
.then((result) => {
console.log(result);
})
.catch((err) => {
console.log(err);
});
Output Log: