Replies: 1 comment 4 replies
-
| Regarding Complexity is handled by the underlying GraphQL library To add stuff to |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to add stats to certain results: the duration the query took and the calculated complexity.
Assumed: best to be done using field middleware?
E.g.:
type Query { posts: [Post!]! @paginate(defaultCount: 10) @stats }Complexity is enabled in lighthouse.php config: e.g.
'max_query_complexity' => 1000.What I tried:
php artisan lighthouse:directive --field statsand selectedFieldMiddleware.This created the stub:
BTW I believe that should be without $next?
(interface says:
public function handleField(FieldValue $fieldValue): void;)Based on the documentation I added:
How to retrieve the calculated complexity, and how to add the duration and complexity to the result?
Beta Was this translation helpful? Give feedback.
All reactions