Skip to content

Instantly share code, notes, and snippets.

@CakeCrusher
Created April 2, 2022 01:42
Show Gist options
  • Save CakeCrusher/43f7e42060adc7d007d870f1c229a327 to your computer and use it in GitHub Desktop.
Save CakeCrusher/43f7e42060adc7d007d870f1c229a327 to your computer and use it in GitHub Desktop.
var axios = require("axios");
var data = JSON.stringify({
query: `mutation CatalogueMacro($catalogue: CatalogueInput!) {
catalogueMacro(catalogue: $catalogue)
}`,
variables: {
catalogue: {
title: "Summer 2022 Materials",
status: "public",
description:
"Be prepared for success with these materialswith these materials!",
header_image_url:
"https://storage.googleapis.com/givespace-pictures/UoF banner1648651124064.png",
header_color: "#495fb6",
author: "University of Farmington",
profile_picture_url:
"https://storage.googleapis.com/givespace-pictures/University_of_Farmington_logo1648650654721.png",
event_date: "2022-06-13",
labels: [
{
name: "CHM2414",
ordering: 1,
},
{
name: "MTH1105",
ordering: 2,
},
{
name: "ENL3045",
ordering: 3,
},
{
name: "optional",
ordering: 4,
},
],
listings: [
{
name: "Fahrenheit 451",
ordering: 5,
},
{
name: "Calculus: Early Transcendental Functions",
link_url:
"https://www.mheducation.com/highered/product/calculus-smith-minton/M9780073383118.html",
ordering: 1,
links: [
{
url: "https://www.mheducation.com/highered/product/calculus-smith-minton/digital/M9780073383118.html",
title: "Digital",
},
{
url: "https://www.mheducation.com/highered/product/calculus-smith-minton/M9780073383118.html",
title: "Hardcover",
},
],
labels: [
{
label_name: "MTH1105",
},
],
},
{
name: "Texas Instruments TI-30XIIS Scientific Calculator, Black with Blue Accents",
ordering: 2,
labels: [
{
label_name: "MTH1105",
},
{
label_name: "optional",
},
],
},
],
},
},
});
var config = {
method: "post",
url: "https://www.kuoly.com/graphql",
headers: {
"Content-Type": "application/json",
},
data: data,
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment