import { GraphQLClient, gql } from 'graphql-request';
const API_URL = 'https://transactional-graph.staging.fluzapp.com/api/v1/graphql';
const GET_STATUS = gql`
query GetVirtualCardBulkOrderStatus {
getVirtualCardBulkOrderStatus(
input: { orderId: "<<ORDER_ID>>" }
) {
orderStatus
orderId
virtualCards {
cardNumber
expiryMMYY
cvv
cardHolderName
virtualCardId
}
successfulCardCreations
failedCardCreations
totalCards
}
}
`;
const client = new GraphQLClient(API_URL, {
headers: {
Authorization: `Bearer <<USER_ACCESS_TOKEN>>`,
'Content-Type': 'application/json',
},
});
const response = await client.request(GET_STATUS);
console.log(response);