Is it possible to fetch events for multiple repositories, in a single call?

schema-request

#1

Hi,

I’d like to get Events for forked repositories, by specifying a source repository.

Using REST I can achieve this with the following calls:

  1. Get forks
    GET https://api.github.com/repos/user/repo/forks

  2. Get fork events for each fork
    for fork in forks
    GET https://api.github.com/repos/user/repo/events

So if I have 70 forks, I will need 1 request to get all forks, and 70 requests to get events for each fork…possible but not ideal!

Wondering what would be the way to work with GraphQL and get those results with fewer calls. Ideally I’d like to find the nested query that will bring all results in one call, but if this is not possible, I’d like to ask for
events on multiple repositories at the same time.

So far I haven’t seen references regarding Events (on REST that would be https://developer.github.com/v3/activity/events/#list-repository-events) . Are they supported on GraphQL or not yet? I’m interested for PushEvents and CreateEvents.

Appreciate any pointer to documentation or code!

Thanks and regards
Markos


#2

Hi @mgogoulos,

Unfortunately the data in the events REST API is not yet supported in GraphQL. I’ve added this as a schema request to our internal tracker.


#3

Nice, thanks for the reply. I think that will be useful to other people as well.

Regards