-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added timeboxed Auditevents example to the GraphQL Cookbook #2301
Conversation
Preview URL: https://2301--bk-docs-preview.netlify.app |
@@ -807,6 +807,7 @@ query { | |||
} | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Thanks :)
@@ -851,6 +852,32 @@ Query your organization's audit events. Audit events are only available to Enter | |||
} | |||
``` | |||
|
|||
### Get timeboxed organization audit events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this still relates to audit events, I think it might be good to include it under the same heading. Thinking:
### Get organization audit events
Query your organization's audit events. Audit events are only available to Enterprise customers.
To get the first 500 audit events, use the following query:
```graphql
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 getOrganizationAuditEvents{
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
}
}
}
}
}
}
```
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tweaked it to the above @mbelton-buildkite 🙂
Probably not needing that H2 anyway since its the same context, just filters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last comment about indenting, but otherwise looks good :)
query getOrganizationAuditEvents{ | ||
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 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs to be indented?
query getOrganizationAuditEvents{ | |
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 | |
} | |
} | |
} | |
} | |
} | |
} | |
query getOrganizationAuditEvents{ | |
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 | |
} | |
} | |
} | |
} | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed that extra indentation @mbelton-buildkite 😉 (sitting on me for a bit - apologies!)
Nice! Looks good to merge when you're ready :) |
Similar to what we have for the
auditEvents
query, just with a example usingoccurredAtFrom
andoccurredAtTo
filtering