I've been tasked with a project that requires the use of API. I would love to learn if possible, how to delve into an object using node-fetch API.
I am looking to fetch a list of objects on a page, I am currently able to receive information as to where the data is stored, however it's left me questioning whether it would be possible.
I have fetched from the url as required, input all options I would need to access said data.
const response = await fetch("https://alt-platform-server.production.internal.onlyalt.com/graphql/MultiPartItemGroupsComplete", {
I ensured that the body and method were setup correctly.
"body": "{\"operationName\":\"MultiPartItemGroupsComplete\",\"variables\":{\"input\":{\"cursor\":null,\"limit\":100}},\"query\":\"query MultiPartItemGroupsComplete($input: ItemGroupsInput!) {\\n itemGroups(input: $input) {\\n itemGroups {\\n items {\\n ...MultiPartItemInitial\\n ...MultiPartItemDetails\\n __typename\\n }\\n __typename\\n }\\n cursor\\n totalCount\\n __typename\\n }\\n}\\n\\nfragment MultiPartItemInitial on Item {\\n id\\n displayNames {\\n ...ItemDisplayNamesBase\\n __typename\\n }\\n images {\\n ...ImageBase\\n __typename\\n }\\n __typename\\n}\\n\\nfragment ItemDisplayNamesBase on ItemDisplayNames {\\n itemName\\n groupName\\n assetName\\n __typename\\n}\\n\\nfragment ImageBase on Image {\\n position\\n url\\n __typename\\n}\\n\\nfragment MultiPartItemDetails on Item {\\n id\\n purchaseDate\\n timeSeriesStats {\\n ...PortfolioTimeSeriesStatsBase\\n __typename\\n }\\n attributes {\\n ...ItemAttributesBase\\n __typename\\n }\\n itemVaultState {\\n ...ItemVaultStateBase\\n __typename\\n }\\n listing {\\n ...ItemListingBase\\n __typename\\n }\\n __typename\\n}\\n\\nfragment PortfolioTimeSeriesStatsBase on TimeSeriesStats {\\n latestValue\\n costBasis\\n changeOverWeek\\n changeOverWeekPercent\\n unrealizedGain\\n unrealizedGainPercent\\n __typename\\n}\\n\\nfragment ItemAttributesBase on ItemAttributes {\\n gradeNumber\\n gradingCompany\\n serial\\n printRun\\n certNumber\\n autograph\\n centering\\n corners\\n edges\\n surfaces\\n qualifier\\n __typename\\n}\\n\\nfragment ItemVaultStateBase on ItemVaultState {\\n createdAt\\n state\\n __typename\\n}\\n\\nfragment ItemListingBase on Listing {\\n id\\n state\\n listPrice\\n type\\n __typename\\n}\\n\"}",
"method": "POST"
But when I output I receive:
{
data: {
itemGroups: {
itemGroups: [Array],
cursor: '1668524928.869299:a735305e-eec9-4ae5-a7ef-04acc3d36023',
totalCount: 3283,
__typename: 'ItemGroupsPayload'
}
}
}
I am looking to get into the [Array], however can't see how it would be possible.