Open slimsag opened 5 years ago
The aggressive caching is something I have been wanting to do for a while. I have some ideas around designs for this so the cache is per request which should solve most of our issues without needing to worry about ACLs/invalidation/etc.
Remove GraphQL fields that allow for creating poor queries
I think this is the wrong direction, that is the nice thing about graphql. We should instead improve our graphql backend layer.
Fix bad uses as they come up?
The problem with this is just how easy it is to do today. I intend to document some of these, but it's incredibly easy to construct such queries today that have detrimental side effects. I anticipate this happening frequently.
Rate limits? Maybe ones you can opt out of, for the legitimate use case.
This SGTM.
I think this is the wrong direction, that is the nice thing about graphql. We should instead improve our graphql backend layer.
Makes sense, this is helpful I appreciate you saying this.
See also https://github.com/sourcegraph/sourcegraph/issues/5705 which is the catch-all issue for this problem with our GraphQL API. This issue is specifically about the bad query linked in the description.
The following query takes several minutes to complete because I ask for the list of
contributors
for each searchresult
. This translates into us runninggit shortlog -sne
once for every single result, despite the fact that they all came from the same repository:bad query
This is one example of how making GraphQL APIs performant is quite difficult in my view. What is the way to fix this? I see a few options: