Querying global returns error: "Trying to get property of non-object"
Howdy all. I'm getting an error every time I try to query globals. This is the query I'm running:
query testGlobal {
globals(site: "supplyChain") {
... on GlobalsSet {
test {
... on Test {
test
}
}
}
}
}
This returns:
{
"error": "Trying to get property of non-object"
}
I have pulled several versions of CraftQL, most resulting in the same error.
If there is more information I need to provide, please let me know.
Edit: I should add that the global Test has only a string input field. This error occurs with most fieldtypes I have used, though.
Sorry, everyone. 😬 first time making a PR. While I'm not sure this is the correct way to fix the issue, it did solve it locally. I can query globals and the response contains the correct information.
@jermashley would be nice to know how you solved it locally - I am currently facing the same issue. Can you give any advice?
@jermashley would be nice to know how you solved it locally - I am currently facing the same issue. Can you give any advice?
I made this change on my local setup and it fixed the issue. https://github.com/markhuot/craftql/pull/224/commits/5228c8f9b6e5a1cc7753310eced1fa67949f56a1
@jermashley, I left you a comment over here, https://github.com/jermashley/craftql/pull/1
I'll get this merged in if you can update the PR to point to my upstream repo.
+1.
Creating any global and then removing it from craft produces this issue. Unable to query anything from globals afterwards.
Fix by @jermashley works.
Having the same issue. @jermashley thanks for the fix, it works great.
Experiencing the same issue.
@markhuot, will you be able to make a release soon?