movio / bramble

A federated GraphQL API gateway
https://movio.github.io/bramble/
MIT License
497 stars 53 forks source link

Handle empty fragment spread being first in query #216

Closed pkqk closed 1 year ago

pkqk commented 1 year ago

The previous fix only handled cases where an empty fragment returned nothing after a field had already been written, if it was first and returned nothing the subsequent fields would write an invalid comma ahead of the innerBody.

As discussed in #215 we need to rewrite this in a more robust way without relying on string building but this should handle the bug for now.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05 :tada:

Comparison is base (2f9e0bf) 71.00% compared to head (77261c0) 71.06%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #216 +/- ## ========================================== + Coverage 71.00% 71.06% +0.05% ========================================== Files 27 27 Lines 2735 2737 +2 ========================================== + Hits 1942 1945 +3 + Misses 671 670 -1 Partials 122 122 ``` | [Impacted Files](https://app.codecov.io/gh/movio/bramble/pull/216?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=movio) | Coverage Δ | | |---|---|---| | [execution\_result.go](https://app.codecov.io/gh/movio/bramble/pull/216?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=movio#diff-ZXhlY3V0aW9uX3Jlc3VsdC5nbw==) | `72.05% <100.00%> (+0.24%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/movio/bramble/pull/216/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=movio)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.