dataModelId is the ID of the data model you are using.
You can fetch an already prepared query from the dashboard for the data model you are using.
const axios = require("axios");
let data = JSON.stringify({
query: `YOUR_GRAPHQL_QUERY_HERE`,
variables: {},
});
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://sandbox.protocol.mygateway.xyz/graphql",
headers: {
"X-Api-Key": "<YOUR_API_KEY>",
Authorization: "Bearer <YOUR_AUTHENTICATION_TOKEN>",
"Content-Type": "application/json",
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
{
"data": {
"createPDA": {
"id": "69786e9a-52c9-42ec-945f-c5b4987d0b3b",
"arweaveUrl": "https://arweave.net/rprGIebHqyxuIRVQaCYTGrrQg2k4Io8vXP7kNOOZC68",
"dataAsset": {
"owner": {
"id": "dffb7a18-d2a4-472e-ac46-4f069b1e8ead",
"gatewayId": "saviour1001"
},
"issuer": {
"id": "dffb7a18-d2a4-472e-ac46-4f069b1e8ead",
"gatewayId": "saviour1001"
}
}
}
}
}
Personal Data Assets
Creating a PDA
You have to write a mutation to create a PDA. The mutation should be written in the following format:
You have to put in the parameters according to the data model you are using.
The