Skip to content

Commit

Permalink
Merge pull request #1101 from griffithlab/jmcmichael-patch-1
Browse files Browse the repository at this point in the history
added include_automated_events option to activities resolver
  • Loading branch information
acoffman authored Aug 22, 2024
2 parents b83d0c3 + 8950138 commit ce83685
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
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

0 comments on commit ce83685

Please sign in to comment.