Use [GraphQL v4](https://developer.github.com/v4/). Check into the [`ghrecipes`](https://github.com/ropenscilabs/ghrecipes) R package for how they implement it. (seems they use [`ghql`](https://github.com/ropensci/ghql) package)
Use GraphQL v4. Check into the
ghrecipesR package for how they implement it. (seems they useghqlpackage)