Closed joseffb-mla closed 5 years ago
It looks like it had trouble getting a featuredImage
Does one of the posts have a featured image assigned but the image has since been deleted?
Based on the path of the error:
"path": [
"apples",
"edges",
5,
"node",
"featuredImage"
]
can you also share the results of the query?
Ok that makes sense as itβs dummy data.
How do you prevent this in a general sense as some may have images others not?
Regards, Joseff
Joseff Betancourt Sr. Website Developer jbetancourt@mla.org
On Apr 10, 2019, at 1:37 PM, Jason Bahl notifications@github.com wrote:
It looks like it had trouble getting a featuredImage
Does one of the posts have a featured image assigned but the image has since been deleted?
β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wp-graphql/wp-graphql-tax-query/issues/9#issuecomment-481788977, or mute the thread https://github.com/notifications/unsubscribe-auth/Aq5Zk1trpx8zNSgMZOfV6_fpsbNGOy2Cks5vfiFGgaJpZM4cn3hg.
Well, without knowing your dataset, my guess is you have a post that has a thumbnail_id
as meta, but that ID is either invalid or belongs to an image that's since been deleted. Just a guess.
The error doesn't mean that your application will break, just that a particular node wasn't found.
Check that 5th apple's featured image ID and see if it's valid or not
is ID 1218 a featured image ID? or a post ID?
"data": {
"apples": {
"edges": [
{
"cursor": "YXJyYXljb25uZWN0aW9uOjEyMTc=",
"node": {
"appleId": 1217,
"title": "Introduction to title",
"slug": "introduction-to-title",
"content": "some html content <p>here here here</p>",
"featuredImage": null,
"tags": {
"edges": [
{
"node": {
"name": "Assignments"
}
},
{
"node": {
"name": "getting started"
}
},
{
"node": {
"name": "Syllabi"
}
},
{
"node": {
"name": "Video"
}
}
]
},
"genres": {
"edges": [
{
"node": {
"name": "Syllabus"
}
}
]
},
"keywords": {
"edges": [
{
"node": {
"name": "Video"
}
}
]
},
"authors": {
"edges": [
{
"node": {
"name": "David"
}
}
]
},
"citations": {
"edges": []
},
"related_works": {
"edges": []
}
}
},...more
1218 would be an appleID
can you share the results of apple 1218
?
Hmm it's not in the results. Looks like it got skipped. I believe that one does have an image uri -- double checking.
can you share the full results of that query? in a GIST or something if it's too long for these comments?
I think it's an orphaned record from my master db to my dev db. One sec (checking). or not. ...
but, this is actually one of the neat things about GraphQL, in my opinion. . .even if there's a partial failure somewhere, it doesn't kill the entire request like most REST APIs would.
You can still get the data that is successful and troubleshoot the errors without your entire app breaking
yea its nice.
So I'm not finding a 1218 (via wp edit screen) in my test db. But then I'm wondering how it's finding it in graphql. Also I did a video tax query but my video tax doesnt have any articles attached to it (was a partial import from master db due to size).
hmm
ok sorry it does have video tags (but the count on the keyword tax page isn't working for some reason.)
ok so seems the tax is looking for 1218 for some reason (which doesn't exist).
No item was found with ID 1218 -- which is correct because it doesn't exists. odd
@joseffb-mla it looks like it's a meta field, on a post. I believe 1218 is a featured image ID, but that featured image was deleted.
So, when you're asking for
node {
feauturedImage
}
It tries to load image 1218
check the post_meta for the posts and see if any of them have thumbnail_id
set to 1218
ah ok I think I got it -- makes sense because media are post too
Indeed these are error messages from orphaned post_meta's.
π₯
Sweet!!!
I think we can close this issue, eh?
I'll need to return to this to ensure featuredImage works (just tried it and its still showing up null), but I think that solves this specific ticket.
Thanks Jason, your a super star for actually spending time helping me reside these issues.
@joseffb-mla my pleasure. Consider writing a blog post or something about your experience with WPGraphQL. Share the good news of how awesome this tech is π
Yea I'm planning on putting together some examples for the docs page as we discussed. Just want to get this app unto my dev servers (off local). I'm learning up Apollo client at moment and learning tons along the way.
Apollo is Amazing! I actually teach a course on Apollo. . .it's in-person though. Hope to have time to convert it to an online course at some point. π
Off topic: Is there a GraphQL Slack that you know of? Cause I do have some q's about the client->query, and redux implmentation. (although more info at this point since i mustered past into enlightenment already lol).
Seems everything is react components and no easy way to get data object. I finally figured it out though.
Apollo recently moved off slack to Spectrum.chat here: https://spectrum.chat/apollo
Apollo has it's own version of local state management to essentially replace Redux. You can still use Redux if you need to, but many seem to find it easier to use Apollo Local State.
We also have a WPGraphQL slack that you can join here: https://wpgql-slack.herokuapp.com/ and a WPGraphQL Spectrum here: https://spectrum.chat/wpgraphql
Error:
Query:
So I get results in the data part of result, but inthe error area of result I'm given the LoadKey error for each result. Not sure whats wrong here.