Closed khalwat closed 6 years ago
FYI, the "You can explore…" / token browse link is fixed on dev-master
. I'm working on error reporting and overall better management of querying separately. Will leave this open until that merges.
Just ran into the same problem @khalwat had (entries field in a matrix w/o permissions). A better error were would be great :)
FYI, I updated the Entries field type to match all the other entries
fields across CraftQL. The upside of this is that if you ask an entries
field for the related entries you'll only get back entries you have access too. The downside is that there's no error any more, it just silently removes any entries you don't have access to…
This is on dev-master
for your review.
So this is clearly a PEBCAK problem, in that I had the wrong permissions (more below) but it took longer than I'd expected to figure out what was going wrong due to the error (or lack thereof) that was returned.
I have the following query:
In this case,
questionAnswers
is a SuperTable field, with bothnextQuestion
andinsight
being Entries fields that the user can pick an entry from in the AdminCP.This query works fine in GraphiQL:
However on the frontend when queried via graphql-request I get a
500
error from the server:Which was very strange, because it worked fine with the
nextQuestion
Entries field. The stack trace was also somewhat unhelpful in pointing me in the right direction:The issue only happened if an actual entry was selected in the
insight
Entries field. It ends up just being that the token permissions were wrong:...but perhaps some better error reporting is in order here?
Incidentally, if I click on the
You can explore your API with the permissions of this token in GraphiQL.
link from the Token Scopes page, I just get a screen that says Loading and nothing ever loads, so I can't test the token permissions via GraphiQL that way.