Skip to content

Expose followed users' activity in the GraphQL API

What does this MR do and why?

Expose followed users' activity in the GraphQL API

Adds the ability to query followed users' activity through the GraphQL API.

This is a lightweight version of !177507 (closed). In this MR, we only expose followed users' activity as the current user's activity is already available in the REST API. We also don't expose push events. This is an experimental API which we'll be using to build out a new homepage prototype as part of #514804 (closed), so we don't need this to be complete yet.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

http://gdk.test:3000/-/graphql-explorer

query UserActivity {
  currentUser {
    activity {
      followedUsersActivity {
        nodes {
          action
          project {
            name
          }
          target {
            ... on Design {
              id
            }
            ... on Issue {
              title
            }
            ... on Note {
              id
            }
            ... on MergeRequest {
              title
            }
            ... on Milestone {
              title
            }
            ... on Project {
              fullPath
            }
            ... on Snippet {
              title
            }
            ... on UserCore {
              username
            }
            ... on WikiPage {
              title
            }
            __typename
          }
        }
      }
    }
  }
}
Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading