The documentation I linked was info on fetch and promises. Query is not fetch, so it doesn't return the same thing and you won't get Received response: 200
[SOLVED] Retrieve promise object data from graphql query
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
I understand.
Rank 2: Process
I was getting an "undefined" response. How do i resolve that?
Log response to see if that will help you figure out how to use it
Rank 2: Process
it hasn't helped
What is your code now? With logging response?
Rank 2: Process
You should know how to work with response now
Rank 2: Process
well I didn't get any data in that response which I should have, but I can't get that json again. I'm only getting the red error in the photo
You're getting that error because there's something wrong with your code
Rank 2: Process
Please tell me how I could find out the proper response code since the following is incorrect:
if (!response.ok) {
}
Response doesn't have an ok property. Look at what was logged
Rank 2: Process
Rank 2: Process
This is actually a desired object, rather than a bad response... but I don't have the conditional correct
Rank 2: Process
yes. I did see that sometimes an error array will exist when I forced an error
Rank 2: Process
I'm able to get information up to console.log(response.data.search1.documents[0].data); but I can't access the attributes under the documents data. For example I want to access group_a value of "bye" I will try mapping
Rank 2: Process
Can you tell what the type is for the value of the document data?
Rank 2: Process
string
Rank 2: Process
maybe I need to convert it
Rank 2: Process
EUREKA!
Rank 2: Process
THANK you for walking with me on this journey 😄
Rank 2: Process
[SOLVED] Retrieve promise object data from graphql query