import { GraphQLClient, gql } from 'graphql-request';
const API_URL = 'https://transactional-graph.staging.fluzapp.com/api/v1/graphql';
const REVEAL_VIRTUAL_CARD = gql`
mutation RevealVirtualCardByVirtualCardId {
revealVirtualCardByVirtualCardId(
virtualCardId: "c107e50b-10f3-449c-92c0-609d9a8cfa2a"
) {
cardNumber
expiryMMYY
cvv
cardHolderName
billingAddress {
streetAddress
postalCode
city
state
}
}
}
`;
const client = new GraphQLClient(API_URL, {
headers: {
Authorization: `Bearer <<USER_ACCESS_TOKEN>>`,
'Content-Type': 'application/json',
},
});
const response = await client.request(REVEAL_VIRTUAL_CARD);
console.log(response);