[PR #5968] feat(backend): add teamsOfUserByAdmin query to list all teams a user belongs to #5439

Open
opened 2026-03-17 02:52:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5968
Author: @mirarifhasan
Created: 3/9/2026
Status: 🔄 Open

Base: nextHead: feat/user-with-team


📝 Commits (6)

  • 0ba6dad feat: add teams field resolver to User type
  • 0818fc9 feat: replace UserTeamsResolver with admin teamsOfUser
  • 540ebf7 chore: update gql query name
  • 70ac874 feat: add user teams management component and GraphQL query
  • b173a07 feat: add fallback for unknown team roles in user teams component
  • 30060d1 feat: add conditional rendering for teams tab and track tab state

📊 Changes

6 files changed (+182 additions, -5 deletions)

View changed files

📝 packages/hoppscotch-backend/src/gql-schema.ts (+0 -2)
📝 packages/hoppscotch-backend/src/team/team.resolver.ts (+24 -0)
📝 packages/hoppscotch-sh-admin/locales/en.json (+10 -0)
packages/hoppscotch-sh-admin/src/components/users/Teams.vue (+112 -0)
packages/hoppscotch-sh-admin/src/helpers/backend/gql/queries/TeamsOfUserByAdmin.graphql (+13 -0)
📝 packages/hoppscotch-sh-admin/src/pages/users/_id.vue (+23 -3)

📄 Description

Closes BE-733

What's changed

Adds a teamsOfUserByAdmin GraphQL query that returns the list of teams the user is a member of, with cursor-based pagination.

Usage

query {
  teamsOfUserByAdmin(
    userUid: "cmm55c5mk00000ypkfx75schs"
    cursor: "cmmaq65550006o4lsbczflmn0" # nullable
  ) {
    id
    name
  }
}

Notes to reviewers

Nil


Summary by cubic

Adds an admin-only teamsOfUserByAdmin(userUid, cursor?) GraphQL query and wires it to the admin UI to list a user’s workspace memberships with cursor pagination. Replaces the previous User.teams field resolver to satisfy BE-733.

  • New Features
    • Exposes teamsOfUserByAdmin(userUid: ID!, cursor?: ID) on Query (auth + admin), and removes TeamEnvsTeamResolver and UserCollectionResolver from RESOLVERS.
    • Adds a “Workspaces” tab on the admin user page with lazy loading, role badges (with “Unknown” fallback), and “Show more” pagination backed by the new query.

Written for commit 30060d1c1878404f2470d40fcf436888154e37f1. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5968 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 3/9/2026 **Status:** 🔄 Open **Base:** `next` ← **Head:** `feat/user-with-team` --- ### 📝 Commits (6) - [`0ba6dad`](https://github.com/hoppscotch/hoppscotch/commit/0ba6dad2963f26521905d724b0ac5f1827cca04a) feat: add `teams` field resolver to User type - [`0818fc9`](https://github.com/hoppscotch/hoppscotch/commit/0818fc9396e0e4c74f5c482f1814eecc904a0ac3) feat: replace UserTeamsResolver with admin teamsOfUser - [`540ebf7`](https://github.com/hoppscotch/hoppscotch/commit/540ebf7778040c104b2a7895c16e0b8a3aa8c497) chore: update gql query name - [`70ac874`](https://github.com/hoppscotch/hoppscotch/commit/70ac874ad81f692450912d370e65de5ec427899c) feat: add user teams management component and GraphQL query - [`b173a07`](https://github.com/hoppscotch/hoppscotch/commit/b173a0702bee8ed62074a57487deeec427ace0ea) feat: add fallback for unknown team roles in user teams component - [`30060d1`](https://github.com/hoppscotch/hoppscotch/commit/30060d1c1878404f2470d40fcf436888154e37f1) feat: add conditional rendering for teams tab and track tab state ### 📊 Changes **6 files changed** (+182 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/gql-schema.ts` (+0 -2) 📝 `packages/hoppscotch-backend/src/team/team.resolver.ts` (+24 -0) 📝 `packages/hoppscotch-sh-admin/locales/en.json` (+10 -0) ➕ `packages/hoppscotch-sh-admin/src/components/users/Teams.vue` (+112 -0) ➕ `packages/hoppscotch-sh-admin/src/helpers/backend/gql/queries/TeamsOfUserByAdmin.graphql` (+13 -0) 📝 `packages/hoppscotch-sh-admin/src/pages/users/_id.vue` (+23 -3) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes BE-733 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed <!-- Describe point by point the different things you have changed in this PR --> Adds a `teamsOfUserByAdmin` GraphQL query that returns the list of teams the user is a member of, with cursor-based pagination. #### Usage ```graphql query { teamsOfUserByAdmin( userUid: "cmm55c5mk00000ypkfx75schs" cursor: "cmmaq65550006o4lsbczflmn0" # nullable ) { id name } } ``` <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> Nil <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds an admin-only `teamsOfUserByAdmin(userUid, cursor?)` GraphQL query and wires it to the admin UI to list a user’s workspace memberships with cursor pagination. Replaces the previous `User.teams` field resolver to satisfy BE-733. - **New Features** - Exposes `teamsOfUserByAdmin(userUid: ID!, cursor?: ID)` on `Query` (auth + admin), and removes `TeamEnvsTeamResolver` and `UserCollectionResolver` from `RESOLVERS`. - Adds a “Workspaces” tab on the admin user page with lazy loading, role badges (with “Unknown” fallback), and “Show more” pagination backed by the new query. <sup>Written for commit 30060d1c1878404f2470d40fcf436888154e37f1. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5439
No description provided.