-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing raw query for debugging #74
Comments
I think you can achieve this easily with this command:
|
I'm afraid that command will just print the graphical representation of the PHP class, not the GraphQL code we can use in an external tool. |
No i tested this. it shows the current query generated by your builder. Just give it a try. |
I got this error:
|
I see because you are using QueryBuilder. This is an example i'm using right now:
|
Yeah I am using QueryBuilder widely in my setup, so I'd need this feature for QueryBuilder as well. Of course it's a "nice to have". ;) |
You could just get the query from the query builder? Like so? catch (QueryError $exception) {
var_dump((string) $builder->getQuery()); // ...or __toString like suggested. I like this way though
print_r($exception->getErrorDetails());
exit;
} |
Hi! Given a populated Query or QueryBuilder object, is it possible to print the raw query that generated the request?
E.G.:
This would be very useful when something goes wrong and you need the raw query to test it on a GraphQL desktop client (Altair in my case).
Thanks!
The text was updated successfully, but these errors were encountered: