I'm not really sure how to even title this but I'm having an issue getting a non-null value back... I'm hoping someone can help me out and tell me what I'm doing wrong...
The api I'm pulling from returns the following format...
{
"countrytimelinedata": [
{
"info": {
"ourid": 167,
"title": "USA",
"code": "US",
"source": "https://thevirustracker.com/usa-coronavirus-information-us"
}
}
],
"timelineitems": [
{
"1/22/20": {
"new_daily_cases": 1,
"new_daily_deaths": 0,
"total_cases": 1,
"total_recoveries": 0,
"total_deaths": 0
},
"1/23/20": {
"new_daily_cases": 0,
"new_daily_deaths": 0,
"total_cases": 1,
"total_recoveries": 0,
"total_deaths": 0
}
}
]
}
My issue is that I cannot pull anything within the timelineitems array with what I have in my schema
My schema is the following
gql`
extend type Query {
getCountryData: getCountryData
}
type getCountryData {
countrytimelinedata: [countrytimelinedata]
timelineitems: [timelineitems]
}
type countrytimelinedata {
info: Info
}
type Info {
ourid: String!
title: String!
code: String!
source: String!
}
type timelineitems {
timelineitem: [timelineitem]
}
type timelineitem {
new_daily_cases: Int!
new_daily_deaths: Int!
total_cases: Int!
total_recoveries: Int!
total_deaths: Int!
}
`;
I hope this is the right place to ask this, and I'm sorry if I am not understanding something basic.
Is there something better I should be using?
Thank you in advance