GraphQL audit queries return partial data

Hello,

I’m trying to use GraphQL API to monitor audit logs in my organization.

For most of the queries it works great, but there are some actions that appear in the organization’s audit log page and are not retreivied via GraphQL API.

For example, all protected_branch and hook related actions can be seen via the audit log organization page, but retreive no results when searching for them using the GraphQL API.

They return nothing when using a query:“action:protected_branch” or when simply trying to retreive all entries without any filter whatsoever.

Is there a list of specific audit entries that are not accessible via GraphQL?
Is there a plan of supporting them?

Thanks

2 Likes

For anyone that is interested, I am attaching the answer from a Github support:

As you’ve found, the audit log search query action:protected_branch is not yet supported by our GraphQL API. The GraphQL AuditEntry interface reference lists the currently supported audit log entry types.

Although this search query is likely to be supported by our GraphQL API at some point, I don’t have firm details at this time. If it’s added, there’ll be an announcement in our developer blog, so it’s worth keeping an eye on that.

After specifiying that this is an important functionality, I also received the following reply:

I agree - this functionality would be extremely useful. As such, I’ve opened an internal feature request to add support for all audit log search queries to our GraphQL API.

Let me know if I can be of further help!

Branch protection audit logs are among the most critical logs. It would be great if they were added to the GraphQL API.

Has there been any progress on this?

Thank you.

1 Like

I’ve replied to the email thread in which the support updated me that it was added as an internal feature request.

I’ve asked what is the status/ETA of the feature.

I’ll update when they will get back to me.