Skip to main content
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);
  });
You can fetch all your PDAs by using myPDAs query.
query myPDAs {
  myPDAs {
    id
    issuanceDate
    ownerHash
    dataAsset {
      dataModel {
        id
      }
      claim
      organization {
        id
        gatewayId
      }
      owner {
        id
        gatewayId
      }
      issuer {
        id
      }
    }
    status
  }
}
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);
  });
I