GraphQL fetching 'Github Apps' audit logs

Hello,

I’m trying to fetch all audit logs for Github apps.
For example, I want to run the following query (from Audit logs) in graphQL -
action:integration_installation_request.create but do not seem to find how.
My current settings:


query {
                            organization(login: "company") {
 
                                auditLog(first: 100) {
                                    edges {
                                        node {
                                        ... on RepositoryAuditEntryData {
                                            repository {
                                                name
                                            }
                                        }
                                        ... on OrgUpdateMemberAuditEntry {
                                            actorResourcePath
                                            actorLogin
                                            action
                                            actorIp
                                            userUrl
                                            user {
                                                name
                                                login
                                            }
                                            permissionWas
                                            permission
                                            actorLogin
                                            actorLocation {
                                            countryCode
                                            country
                                            regionCode
                                            region
                                            city
                                            }
                                        }
                                        ... on Bot {
                                          login
                                        }
                                        ... on OrgAddMemberAuditEntry {
                                            action
                                            actorIp
                                            organizationName
                                            user {
                                                name
                                                login
                                            }
                                            userLogin
                                            userResourcePath
                                            userUrl
                                        }
                                        ... on OrgRemoveMemberAuditEntry {
                                            action
                                            actorIp
                                            organizationName
                                            user {
                                                name
                                                login
                                            }
                                            userLogin
                                            userResourcePath
                                            userUrl
                                        }
                                        ... on AuditEntry {
                                            actorResourcePath
                                            action
                                            actorIp
                                            actorLogin
                                            operationType
                                            createdAt
                                            actorLocation {
                                                countryCode
                                                country
                                                regionCode
                                                region
                                                city
                                            }
                                            #User 'Action' was performed on
                                            userLogin
                                            userResourcePath
                                            userUrl
                                        }
                                    }
                                        
                                        cursor
                                    }
                                    pageInfo {
                                        endCursor
                                        hasNextPage
                                        hasPreviousPage
                                    }
                                }
                            }
  
                        }

but it returns “message”: “Fragment on Bot can’t be spread inside OrganizationAuditEntry”
It works if ‘… on Bot’ part is removed.
From what I understand, Bot will be able to provide the information I need to monitor github apps activity.
I understand that there’s something wrong in my query but GraphQL isn’t really my expretise…
Any help on understanding 1) how to query ‘Bot’. 2) How to monitor gibhub apps activity using GraphQL- would be appreciated.

Thanks!

1 Like