#import "../fragments/user.fragment.graphql"
#import "~/graphql_shared/fragments/user_availability.fragment.graphql"

query projectUsersSearchWithMRPermissions(
  $search: String!
  $fullPath: ID!
  $mergeRequestId: MergeRequestID!
) {
  workspace: project(fullPath: $fullPath) {
    id
    users: projectMembers(
      search: $search
      relations: [DIRECT, INHERITED, INVITED_GROUPS]
      sort: USER_FULL_NAME_ASC
    ) {
      nodes {
        id
        mergeRequestInteraction(id: $mergeRequestId) {
          canMerge
        }
        user {
          ...User
          ...UserAvailability
        }
      }
    }
  }
}
