nuwave / lighthouse

A framework for serving GraphQL from Laravel
https://lighthouse-php.com
MIT License
3.37k stars 438 forks source link

Duplicate tracing paths in queries with pagination #1566

Open robsontenorio opened 4 years ago

robsontenorio commented 4 years ago

Describe the bug

https://lighthouse-php.com/4.16/performance/tracing.html

Queries with args and pagination duplicates first tracing resolver path.

Expected behavior/Solution

Should be parsed once per path. Am i missing something?

Steps to reproduce

  1. Eneable Tracing
  2. Execute any query with args and pagination
  3. The resulting tracing duplicates first path.

Output/Logs

Click to expand **Duplicates first tracing resolver path** ![image](https://user-images.githubusercontent.com/118955/93518321-060db080-f903-11ea-8a32-dd587f10a40c.png) ![image](https://user-images.githubusercontent.com/118955/93518052-af07db80-f902-11ea-934d-a77509968608.png) ![image](https://user-images.githubusercontent.com/118955/93518092-bfb85180-f902-11ea-9b5e-294943a3af87.png) **Does not duplicates** ![image](https://user-images.githubusercontent.com/118955/93518229-ebd3d280-f902-11ea-9d35-ec2587ec5240.png) ![image](https://user-images.githubusercontent.com/118955/93518161-d52d7b80-f902-11ea-8e18-2f3b5d7e0126.png) ![image](https://user-images.githubusercontent.com/118955/93518180-db235c80-f902-11ea-8b13-f113457f5de3.png)

**Lighthouse Version** 5.alpha-4
spawnia commented 4 years ago

I guess the reason for that might have to do with the AST manipulation that occurs within the @paginate directive: https://github.com/nuwave/lighthouse/blob/f1173128eb21f37f6a15805310ec993961098a92/src/Pagination/PaginateDirective.php#L63-L85