This has been split from #2434.
The idea of this is to leverage the feature from bazelbuild/bazel#24777 when it is available in order to make the SimpleAPI querying more efficient.
Example of how to use the new feature is in rules_go: https://github.com/bazel-contrib/rules_go/pull/4393/files#r2193844919