From 85ce151264bec8a6bcbb5a01259464c909bb0434 Mon Sep 17 00:00:00 2001 From: Alessandro Magionami Date: Tue, 14 Jan 2025 11:34:02 +0100 Subject: [PATCH] feat(workspaces): make query for single workspace --- .../typedefs/workspaces.graphql | 23 +++++----- .../modules/core/graph/generated/graphql.ts | 20 ++++----- .../graph/generated/graphql.ts | 18 ++++---- .../graph/resolvers/workspaceJoinRequests.ts | 7 +-- .../repositories/workspaceJoinRequests.ts | 2 + .../workspaces/tests/helpers/graphql.ts | 35 ++++++++------- .../workspaceJoinRequests.graph.spec.ts | 43 ++++++++++++++----- .../server/test/graphql/generated/graphql.ts | 25 +++++------ 8 files changed, 102 insertions(+), 71 deletions(-) diff --git a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql index 4eb4cc89c8..d1c85e13a8 100644 --- a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql +++ b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql @@ -28,17 +28,6 @@ extend type Query { Validates the slug, to make sure it contains only valid characters and its not taken. """ validateWorkspaceSlug(slug: String!): Boolean! - - """ - Get all join requests for all the workspaces the user is an admin of - """ - adminWorkspacesJoinRequests( - filter: AdminWorkspaceJoinRequestFilter - cursor: String - limit: Int! = 25 - ): WorkspaceJoinRequestCollection! - @hasServerRole(role: SERVER_USER) - @hasScope(scope: "workspace:read") } input WorkspaceInviteLookupOptions { @@ -322,6 +311,18 @@ type Workspace { Info about the workspace creation state """ creationState: WorkspaceCreationState + """ + Get all join requests for all the workspaces the user is an admin of + """ + adminWorkspacesJoinRequests( + filter: AdminWorkspaceJoinRequestFilter + cursor: String + limit: Int! = 25 + ): WorkspaceJoinRequestCollection! + @hasServerRole(role: SERVER_USER) + @hasScope(scope: "workspace:read") + @hasWorkspaceRole(role: ADMIN) + @isOwner } type WorkspaceCreationState { diff --git a/packages/server/modules/core/graph/generated/graphql.ts b/packages/server/modules/core/graph/generated/graphql.ts index 028fb72321..13c1b1adac 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -2531,8 +2531,6 @@ export type Query = { * @deprecated use admin.UserList instead */ adminUsers?: Maybe; - /** Get all join requests for all the workspaces the user is an admin of */ - adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; /** Gets a specific app from the server. */ app?: Maybe; /** @@ -2660,13 +2658,6 @@ export type QueryAdminUsersArgs = { }; -export type QueryAdminWorkspacesJoinRequestsArgs = { - cursor?: InputMaybe; - filter?: InputMaybe; - limit?: Scalars['Int']['input']; -}; - - export type QueryAppArgs = { id: Scalars['String']['input']; }; @@ -4183,6 +4174,8 @@ export type WebhookUpdateInput = { export type Workspace = { __typename?: 'Workspace'; + /** Get all join requests for all the workspaces the user is an admin of */ + adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; automateFunctions: AutomateFunctionCollection; createdAt: Scalars['DateTime']['output']; /** Info about the workspace creation state */ @@ -4226,6 +4219,13 @@ export type Workspace = { }; +export type WorkspaceAdminWorkspacesJoinRequestsArgs = { + cursor?: InputMaybe; + filter?: InputMaybe; + limit?: Scalars['Int']['input']; +}; + + export type WorkspaceAutomateFunctionsArgs = { cursor?: InputMaybe; filter?: InputMaybe; @@ -6235,7 +6235,6 @@ export type QueryResolvers; adminStreams?: Resolver, ParentType, ContextType, RequireFields>; adminUsers?: Resolver, ParentType, ContextType, RequireFields>; - adminWorkspacesJoinRequests?: Resolver>; app?: Resolver, ParentType, ContextType, RequireFields>; apps?: Resolver>>, ParentType, ContextType>; authenticatedAsApp?: Resolver, ParentType, ContextType>; @@ -6759,6 +6758,7 @@ export type WebhookEventCollectionResolvers = { + adminWorkspacesJoinRequests?: Resolver>; automateFunctions?: Resolver>; createdAt?: Resolver; creationState?: Resolver, ParentType, ContextType>; diff --git a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts index 38886cbe82..d724c6e81c 100644 --- a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts +++ b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts @@ -2511,8 +2511,6 @@ export type Query = { * @deprecated use admin.UserList instead */ adminUsers?: Maybe; - /** Get all join requests for all the workspaces the user is an admin of */ - adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; /** Gets a specific app from the server. */ app?: Maybe; /** @@ -2640,13 +2638,6 @@ export type QueryAdminUsersArgs = { }; -export type QueryAdminWorkspacesJoinRequestsArgs = { - cursor?: InputMaybe; - filter?: InputMaybe; - limit?: Scalars['Int']['input']; -}; - - export type QueryAppArgs = { id: Scalars['String']['input']; }; @@ -4163,6 +4154,8 @@ export type WebhookUpdateInput = { export type Workspace = { __typename?: 'Workspace'; + /** Get all join requests for all the workspaces the user is an admin of */ + adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; automateFunctions: AutomateFunctionCollection; createdAt: Scalars['DateTime']['output']; /** Info about the workspace creation state */ @@ -4206,6 +4199,13 @@ export type Workspace = { }; +export type WorkspaceAdminWorkspacesJoinRequestsArgs = { + cursor?: InputMaybe; + filter?: InputMaybe; + limit?: Scalars['Int']['input']; +}; + + export type WorkspaceAutomateFunctionsArgs = { cursor?: InputMaybe; filter?: InputMaybe; diff --git a/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts b/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts index 8f51b0edea..b1654e4dac 100644 --- a/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts +++ b/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts @@ -9,8 +9,8 @@ import { WorkspaceJoinRequestStatus } from '@/modules/workspacesCore/domain/type import { WorkspaceJoinRequestGraphQLReturn } from '@/modules/workspacesCore/helpers/graphTypes' export default { - Query: { - adminWorkspacesJoinRequests: async (_parent, args, ctx) => { + Workspace: { + adminWorkspacesJoinRequests: async (parent, args, ctx) => { const { filter, cursor, limit } = args return await getPaginatedItemsFactory< @@ -28,8 +28,9 @@ export default { getTotalCount: countAdminWorkspaceJoinRequestsFactory({ db }) })({ filter: { + workspaceId: parent.id, status: filter?.status ?? undefined, - userId: ctx.userId! + userId: ctx.userId! // This is the worskpace admin, not the request userId }, cursor: cursor ?? undefined, limit diff --git a/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts index bd6effa5e8..169abbd7ef 100644 --- a/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts +++ b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts @@ -36,6 +36,7 @@ export const updateWorkspaceJoinRequestStatusFactory = } type WorkspaceJoinRequestFilter = { + workspaceId: string status?: WorkspaceJoinRequestStatus | null userId: string } @@ -51,6 +52,7 @@ const adminWorkspaceJoinRequestsBaseQueryFactory = ) .where(WorkspaceAcl.col.role, Roles.Workspace.Admin) .where(WorkspaceAcl.col.userId, filter.userId) + .where(WorkspaceJoinRequests.col.workspaceId, filter.workspaceId) if (filter.status) query.andWhere(WorkspaceJoinRequests.col.status, filter.status) return query } diff --git a/packages/server/modules/workspaces/tests/helpers/graphql.ts b/packages/server/modules/workspaces/tests/helpers/graphql.ts index 653a45b9f3..175ce9b600 100644 --- a/packages/server/modules/workspaces/tests/helpers/graphql.ts +++ b/packages/server/modules/workspaces/tests/helpers/graphql.ts @@ -332,27 +332,32 @@ export const requestToJoinWorkspaceMutation = gql` } ` -export const adminWorkspaceJoinRequestsQuery = gql` - query adminWorkspaceJoinRequests( +export const getWorkspaceWithJoinRequestsQuery = gql` + query GetWorkspaceWithJoinRequests( + $workspaceId: String! $filter: AdminWorkspaceJoinRequestFilter $cursor: String $limit: Int ) { - adminWorkspacesJoinRequests(filter: $filter, cursor: $cursor, limit: $limit) { - items { - status - user { - id - name - } - workspace { - id - name + workspace(id: $workspaceId) { + ...BasicWorkspace + adminWorkspacesJoinRequests(filter: $filter, cursor: $cursor, limit: $limit) { + items { + status + user { + id + name + } + workspace { + id + name + } + createdAt } - createdAt + cursor + totalCount } - cursor - totalCount } } + ${basicWorkspaceFragment} ` diff --git a/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts b/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts index adab67f49f..a95db72052 100644 --- a/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts +++ b/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts @@ -7,7 +7,7 @@ import { createTestUser } from '@/test/authHelper' import { - AdminWorkspaceJoinRequestsDocument, + GetWorkspaceWithJoinRequestsDocument, RequestToJoinWorkspaceDocument } from '@/test/graphql/generated/graphql' import { createTestContext, testApolloServer } from '@/test/graphqlHelper' @@ -34,7 +34,7 @@ before(async () => { }) describe('WorkspaceJoinRequests GQL', () => { - describe('User.adminWorkspacesJoinRequests', () => { + describe('Workspace.adminWorkspacesJoinRequests', () => { it('should return the workspace join requests for the admin', async () => { const admin = await createTestUser({ name: 'admin user', @@ -101,25 +101,46 @@ describe('WorkspaceJoinRequests GQL', () => { expect(joinReq2).to.not.haveGraphQLErrors() const sessionAdmin = await login(admin) - const res = await sessionAdmin.execute(AdminWorkspaceJoinRequestsDocument, {}) - expect(res).to.not.haveGraphQLErrors() + const workspace1Res = await sessionAdmin.execute( + GetWorkspaceWithJoinRequestsDocument, + { + workspaceId: workspace1.id + } + ) + expect(workspace1Res).to.not.haveGraphQLErrors() - const { items, totalCount } = res.data?.adminWorkspacesJoinRequests + const { items: items1, totalCount: totalCount1 } = + workspace1Res.data!.workspace!.adminWorkspacesJoinRequests! - expect(totalCount).to.equal(2) + expect(totalCount1).to.equal(1) - expect(items).to.have.length(2) - assert.deepEqual(items[1], { + expect(items1).to.have.length(1) + assert.deepEqual(items1[0], { status: 'pending', user: { id: user1.id, name: user1.name }, workspace: { id: workspace1.id, name: workspace1.name }, - createdAt: items[1].createdAt + createdAt: items1[0].createdAt }) - assert.deepEqual(items[0], { + + const workspace2Res = await sessionAdmin.execute( + GetWorkspaceWithJoinRequestsDocument, + { + workspaceId: workspace2.id + } + ) + expect(workspace2Res).to.not.haveGraphQLErrors() + + const { items: items2, totalCount: totalCount2 } = + workspace2Res.data!.workspace!.adminWorkspacesJoinRequests! + + expect(totalCount2).to.equal(1) + + expect(items2).to.have.length(1) + assert.deepEqual(items2[0], { status: 'pending', user: { id: user2.id, name: user2.name }, workspace: { id: workspace2.id, name: workspace2.name }, - createdAt: items[0].createdAt + createdAt: items2[0].createdAt }) }) }) diff --git a/packages/server/test/graphql/generated/graphql.ts b/packages/server/test/graphql/generated/graphql.ts index 0a2fe9fa3c..762ccf56c2 100644 --- a/packages/server/test/graphql/generated/graphql.ts +++ b/packages/server/test/graphql/generated/graphql.ts @@ -2512,8 +2512,6 @@ export type Query = { * @deprecated use admin.UserList instead */ adminUsers?: Maybe; - /** Get all join requests for all the workspaces the user is an admin of */ - adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; /** Gets a specific app from the server. */ app?: Maybe; /** @@ -2641,13 +2639,6 @@ export type QueryAdminUsersArgs = { }; -export type QueryAdminWorkspacesJoinRequestsArgs = { - cursor?: InputMaybe; - filter?: InputMaybe; - limit?: Scalars['Int']['input']; -}; - - export type QueryAppArgs = { id: Scalars['String']['input']; }; @@ -4164,6 +4155,8 @@ export type WebhookUpdateInput = { export type Workspace = { __typename?: 'Workspace'; + /** Get all join requests for all the workspaces the user is an admin of */ + adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; automateFunctions: AutomateFunctionCollection; createdAt: Scalars['DateTime']['output']; /** Info about the workspace creation state */ @@ -4207,6 +4200,13 @@ export type Workspace = { }; +export type WorkspaceAdminWorkspacesJoinRequestsArgs = { + cursor?: InputMaybe; + filter?: InputMaybe; + limit?: Scalars['Int']['input']; +}; + + export type WorkspaceAutomateFunctionsArgs = { cursor?: InputMaybe; filter?: InputMaybe; @@ -4937,14 +4937,15 @@ export type RequestToJoinWorkspaceMutationVariables = Exact<{ export type RequestToJoinWorkspaceMutation = { __typename?: 'Mutation', workspaceMutations: { __typename?: 'WorkspaceMutations', requestToJoin: boolean } }; -export type AdminWorkspaceJoinRequestsQueryVariables = Exact<{ +export type GetWorkspaceWithJoinRequestsQueryVariables = Exact<{ + workspaceId: Scalars['String']['input']; filter?: InputMaybe; cursor?: InputMaybe; limit?: InputMaybe; }>; -export type AdminWorkspaceJoinRequestsQuery = { __typename?: 'Query', adminWorkspacesJoinRequests: { __typename?: 'WorkspaceJoinRequestCollection', cursor?: string | null, totalCount: number, items: Array<{ __typename?: 'WorkspaceJoinRequest', status: WorkspaceJoinRequestStatus, createdAt: string, user: { __typename?: 'LimitedUser', id: string, name: string }, workspace: { __typename?: 'Workspace', id: string, name: string } }> } }; +export type GetWorkspaceWithJoinRequestsQuery = { __typename?: 'Query', workspace: { __typename?: 'Workspace', id: string, name: string, slug: string, updatedAt: string, createdAt: string, role?: string | null, readOnly: boolean, adminWorkspacesJoinRequests: { __typename?: 'WorkspaceJoinRequestCollection', cursor?: string | null, totalCount: number, items: Array<{ __typename?: 'WorkspaceJoinRequest', status: WorkspaceJoinRequestStatus, createdAt: string, user: { __typename?: 'LimitedUser', id: string, name: string }, workspace: { __typename?: 'Workspace', id: string, name: string } }> } } }; export type BasicStreamAccessRequestFieldsFragment = { __typename?: 'StreamAccessRequest', id: string, requesterId: string, streamId: string, createdAt: string, requester: { __typename?: 'LimitedUser', id: string, name: string } }; @@ -5651,7 +5652,7 @@ export const OnWorkspaceProjectsUpdatedDocument = {"kind":"Document","definition export const OnWorkspaceUpdatedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnWorkspaceUpdated"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceSlug"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceUpdated"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicWorkspace"}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"invitedTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicPendingWorkspaceCollaborator"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicWorkspace"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicPendingWorkspaceCollaborator"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PendingWorkspaceCollaborator"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inviteId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"invitedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]} as unknown as DocumentNode; export const DismissWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"dismissWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceDismissInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"dismiss"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]} as unknown as DocumentNode; export const RequestToJoinWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"requestToJoinWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceRequestToJoinInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"requestToJoin"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]} as unknown as DocumentNode; -export const AdminWorkspaceJoinRequestsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"adminWorkspaceJoinRequests"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"AdminWorkspaceJoinRequestFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminWorkspacesJoinRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} as unknown as DocumentNode; +export const GetWorkspaceWithJoinRequestsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspaceWithJoinRequests"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"AdminWorkspaceJoinRequestFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicWorkspace"}},{"kind":"Field","name":{"kind":"Name","value":"adminWorkspacesJoinRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicWorkspace"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}}]} as unknown as DocumentNode; export const CreateStreamAccessRequestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateStreamAccessRequest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequestCreate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamAccessRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"requester"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"requesterId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const GetStreamAccessRequestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetStreamAccessRequest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequest"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamAccessRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"requester"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"requesterId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const GetFullStreamAccessRequestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFullStreamAccessRequest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequest"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"}},{"kind":"Field","name":{"kind":"Name","value":"stream"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamAccessRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"requester"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"requesterId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode;