You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a GraphQl query polling data from the WP api. The end point is allWordpressWpJobListing which works perfectly fine.
However, in the case that there are no job listings or that the ones that exist in WP are expired, the api endpoint does not return anything, which causes the following error:
GraphQLError: Cannot query field "allWordpressWp JobListing"
The query is being called in the gatsby-node file as well as in one of my pages.
My questions is how do I manage this - how can I check if the endpoint exists and if not, how to skip it?
Thanks
The text was updated successfully, but these errors were encountered:
keep dummy entry in your wordpress CMS (for example title "DO NOT DELETE" so your content team won't remove it) so Gatsby will always have some data that it can use to create "endpoint"
in your gatsby-node programatically create nodes that will match signature of JobListing (same fields, same type that is used by gatsby-source-wordpress)
Both would need some property in that "dummy" data that would let you filter them out when you create pages / query for data in your page templates.
I will close it for now, as we have issue like this already ( for example #2212 ).
Here's some discussion about proper solution that could be implemented in the future in Gatsby - #3344
Hey,
I've got a GraphQl query polling data from the WP api. The end point is
allWordpressWpJobListing
which works perfectly fine.However, in the case that there are no job listings or that the ones that exist in WP are expired, the api endpoint does not return anything, which causes the following error:
GraphQLError: Cannot query field "allWordpressWp JobListing"
The query is being called in the
gatsby-node
file as well as in one of mypages
.My questions is how do I manage this - how can I check if the endpoint exists and if not, how to skip it?
Thanks
The text was updated successfully, but these errors were encountered: