I am working on an app in React+TS/GraphQL/Prisma. The API is written in GraphQL and when I run a particular query in the playground, I get the data I expect, but when I run the exact same query in react, I get null. Why would this be?
What I run in query (relevant portion)
query {
session {
userData: {
firstName
lastName
dateOfBirth
}
}
}
and in the playground it returns
{
"data": {
"session": {
"userData": {
"firstName":"John",
"lastName":"Doe",
"dateOfBirth":null,
}
}
}
}
but in the App, when I console log the userData or data.session it returns null for the whole object. console.log(data) prints
session: {
userData: null
}
does anyone have any ideas why this would be? The playground accurately pulls user data and populates the subfields, but on the App in the browser, it only returns "null".