Zhekai Xing
Zhekai Xing
Hi, in order to adapt federation, you need to spin up your own GQL gateway service. You can refer to the [example](https://github.com/samsarahq/thunder/blob/32c1284e98af356714f1f674ea55b5bfabaeef33/federationexample/gqlgateway/main.go#L43) for how to create a gateway.
1000 BenchmarkAddDependency-8 3108 373653 ns/op 416930 B/op 3797 allocs/op 1000 BenchmarkAddDependencies-8 4796 262779 ns/op 400647 B/op 3778 allocs/op 10000 BenchmarkAddDependency-8 268 6731772 ns/op 4892092 B/op 39815 allocs/op 10000 BenchmarkAddDependencies-8 447...
I changed the deep copy to only copy the first layer of selections and fragments, the benchmark is as below: ``` BenchmarkNormalize2-16 5040 248245 ns/op 105241 B/op 2232 allocs/op ```
The root cause is `last.SelectionSet.Selections = append(last.SelectionSet.Selections, s)` sometimes create a new slice, sometimes not, when it does not create the new slice, we will run into the bug.