Proposal: Faster Algorithm For OverlappingFieldsCanBeMerged
- Dominant language
- TypeScript
- Stars
- 20.3k
- Forks
- 2.1k
- Avg merge
- 44m
- Merged PRs (30d)
- 6
Description
At [XING](https://www.xing.com) we are using the [Sangria](https://sangria-graphql.org) implementation of GraphQL. The implementation of the OverlappingFieldsCanBeMerged validation in Sangria follows the one in this reference implementation. We experienced performance problems with it related to the number of fragments. After we invested some time to solve it, I came up with a better algorithm, that we are using now.
- [Here](https://tech.new-work.se/graphql-overlapping-fields-can-be-merged-fast-ea6e92e0a01) is the description of the algorithm.
- And [here](https://github.com/sangria-graphql/sangria/pull/458) is our PR for Sangria.
The proposal would be to use this algorithm in the reference implementation. Below is an example benchmark graph showing the performance improvement for multiple fragments in the same selection set.

Contributor guide
Assessment
This issue has not been assessed yet.