1Hive / apiary

Aragon DAO explorer
https://apiary.1hive.org
GNU General Public License v3.0
25 stars 16 forks source link

Add GraphQL endpoint for organisation activity #165

Closed onbjerg closed 4 years ago

onbjerg commented 4 years ago

Requires #159

Implement the DAL and resolver for the following schema, allowing users to fetch activity feeds for specific organisations:

# An origin or destination of an activity.
type ActivityStation {
  # The address of this station.
  address: String!
  # The organisation of this station.
  organisation: Organisation
  # The app ID of this station.
  appId: String
}

type Activity implements Node {
  # The correlation ID of this activity.
  #
  # Correlation IDs are a hash of an entity ID (e.g. a vote ID) and
  # the app proxy address (i.e. `hash(proxyAddress + entityId)`).
  correlationId: String
  # The destination of this activity.
  to: ActivityStation!
  # The origin of this activity.
  from: ActivityStation!
  # The human readable description of this activity.
  description: String
  # A 3Box thread ID for discussions
  discussionId: String!
  # The raw trace associated with this activity.
  trace: Trace!
  # Raw logs associated with this activity.
  logs: [Log]!
  # The decoded call associated with this activity.
  call: Call
  # Decoded events associated with this activity.
  events: [Event]!
  # The timestamp this activity occurred at.
  timestamp: DateTime!
  # Correlated activities where this activity is the root.
  children: [Activity]!
}

type ActivityEdge {
  cursor: Cursor!
  node: Activity
}

type ActivityConnection {
  edges: [ActivityEdge]
  nodes: [Activity]
  pageInfo: PageInfo!
  totalCount: Int!
}

input ActivityConnectionFilter {
  appId: StringOperators
  app: StringOperators
  methodSignature: StringOperators
  timestamp: DateOperators
}

input ActivityConnectionSort {
  timestamp: SortOrder
}

extend type Organisation {
  feed(
    take: Int = 10,
    before: Cursor,
    after: Cursor,
    filter: ActivityConnectionFilter,
    sort: ActivityConnectionSort
  ): ActivityConnection!
}
onbjerg commented 4 years ago

@lkngtn @sembrestels Any thoughts on this?

The Log, Event, Call and Trace types are not defined as of yet, but their names should somewhat explain what they contain.

onbjerg commented 4 years ago

No longer in scope.