Skip to content
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 include_automated_events option to activities resolver #1101

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/src/app/generated/server.model.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7111,6 +7111,7 @@ type Query {
Returns the first _n_ elements from the list.
"""
first: Int
includeAutomatedEvents: Boolean

"""
Returns the last _n_ elements from the list.
Expand Down
12 changes: 12 additions & 0 deletions client/src/app/generated/server.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33864,6 +33864,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "includeAutomatedEvents",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",
Expand Down
9 changes: 9 additions & 0 deletions server/app/graphql/resolvers/activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,14 @@ class Activities < GraphQL::Schema::Resolver
option(:mode, type: Types::Events::EventFeedMode) do |_, _|
#accessed in connection, yuck
end

option(:include_automated_events, type: Boolean, default_value: false) do |scope, value|
if !include_automated_events
scope.where.not(user_id: Constants::CIVICBOT_USER_ID)
else
scope
end
end

end
end
Loading