This has been split from #2434. The idea of this is to leverage the feature from https://github.com/bazelbuild/bazel/issues/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