Skip to content

Commit

Permalink
Merge pull request #2301 from buildkite/audit-event-time
Browse files Browse the repository at this point in the history
Added timeboxed Auditevents example to the GraphQL Cookbook
  • Loading branch information
james2791 authored Aug 11, 2023
2 parents 7a3cf5a + 22b67bc commit 1addf5f
Showing 1 changed file with 37 additions and 13 deletions.
50 changes: 37 additions & 13 deletions pages/apis/graphql/graphql_cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -1004,25 +1004,49 @@ mutation deleteOrgMember {
Query your organization's audit events. Audit events are only available to Enterprise customers.

```graphql
query getOrganizationAuditEvents{
organization(slug:"organization-slug"){
auditEvents(first: 500){
edges{
node{
query getOrganizationAuditEvents{
organization(slug:"organization-slug"){
auditEvents(first: 500){
edges{
node{
type
occurredAt
actor{
name
}
subject{
name
type
}
}
}
}
}
}
```

To get all audit events in a given period, use the `occurredAtFrom` and `occurredAtTo` filters like in the following query:

```graphql
query getTimeScopedOrganizationAuditEvents{
organization(slug:"organization-slug"){
auditEvents(first: 500, occurredAtFrom: "2023-01-01T12:00:00.000", occurredAtTo: "2023-01-01T13:00:00.000"){
edges{
node{
type
occurredAt
actor{
name
}
subject{
name
type
occurredAt
actor{
name
}
subject{
name
type
}
}
}
}
}
}
}
```

## Teams
Expand Down

0 comments on commit 1addf5f

Please sign in to comment.