mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(server): workspace doc query (#10042)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
query getDocDefaultRole($workspaceId: String!, $docId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
doc(docId: $docId) {
|
||||
defaultRole
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
query getWorkspacePageById($workspaceId: String!, $pageId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
doc(docId: $pageId) {
|
||||
id
|
||||
mode
|
||||
defaultRole
|
||||
public
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
query getWorkspacePublicPageById($workspaceId: String!, $pageId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
publicDoc(docId: $pageId) {
|
||||
id
|
||||
mode
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -594,6 +594,21 @@ query getCurrentUser {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getDocDefaultRoleQuery = {
|
||||
id: 'getDocDefaultRoleQuery' as const,
|
||||
operationName: 'getDocDefaultRole',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getDocDefaultRole($workspaceId: String!, $docId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
doc(docId: $docId) {
|
||||
defaultRole
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getInviteInfoQuery = {
|
||||
id: 'getInviteInfoQuery' as const,
|
||||
operationName: 'getInviteInfo',
|
||||
@@ -863,6 +878,24 @@ query getWorkspaceInfo($workspaceId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspacePageByIdQuery = {
|
||||
id: 'getWorkspacePageByIdQuery' as const,
|
||||
operationName: 'getWorkspacePageById',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getWorkspacePageById($workspaceId: String!, $pageId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
doc(docId: $pageId) {
|
||||
id
|
||||
mode
|
||||
defaultRole
|
||||
public
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspacePageMetaByIdQuery = {
|
||||
id: 'getWorkspacePageMetaByIdQuery' as const,
|
||||
operationName: 'getWorkspacePageMetaById',
|
||||
@@ -900,22 +933,6 @@ query getWorkspacePublicById($id: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspacePublicPageByIdQuery = {
|
||||
id: 'getWorkspacePublicPageByIdQuery' as const,
|
||||
operationName: 'getWorkspacePublicPageById',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getWorkspacePublicPageById($workspaceId: String!, $pageId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
publicDoc(docId: $pageId) {
|
||||
id
|
||||
mode
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspacePublicPagesQuery = {
|
||||
id: 'getWorkspacePublicPagesQuery' as const,
|
||||
operationName: 'getWorkspacePublicPages',
|
||||
@@ -1363,6 +1380,17 @@ mutation updateAccount($id: String!, $input: ManageUserInput!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const updateDocDefaultRoleMutation = {
|
||||
id: 'updateDocDefaultRoleMutation' as const,
|
||||
operationName: 'updateDocDefaultRole',
|
||||
definitionName: 'updateDocDefaultRole',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation updateDocDefaultRole($input: UpdateDocDefaultRoleInput!) {
|
||||
updateDocDefaultRole(input: $input)
|
||||
}`,
|
||||
};
|
||||
|
||||
export const updateDocUserRoleMutation = {
|
||||
id: 'updateDocUserRoleMutation' as const,
|
||||
operationName: 'updateDocUserRole',
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
mutation updateDocDefaultRole($input: UpdateDocDefaultRoleInput!) {
|
||||
updateDocDefaultRole(input: $input)
|
||||
}
|
||||
@@ -359,6 +359,7 @@ export enum DocRole {
|
||||
|
||||
export interface DocType {
|
||||
__typename?: 'DocType';
|
||||
defaultRole: DocRole;
|
||||
/** paginated doc granted users list */
|
||||
grantedUsersList: PaginatedGrantedDocUserType;
|
||||
id: Scalars['String']['output'];
|
||||
@@ -1747,13 +1748,11 @@ export interface WorkspaceType {
|
||||
pageMeta: WorkspacePageMeta;
|
||||
/** is Public workspace */
|
||||
public: Scalars['Boolean']['output'];
|
||||
/** Get public page of a workspace by page id. */
|
||||
publicDoc: Maybe<DocType>;
|
||||
/** Get public docs of a workspace */
|
||||
publicDocs: Array<DocType>;
|
||||
/**
|
||||
* Get public page of a workspace by page id.
|
||||
* @deprecated use [WorkspaceType.publicDoc] instead
|
||||
* @deprecated use [WorkspaceType.doc] instead
|
||||
*/
|
||||
publicPage: Maybe<DocType>;
|
||||
/** @deprecated use [WorkspaceType.publicDocs] instead */
|
||||
@@ -1793,10 +1792,6 @@ export interface WorkspaceTypePageMetaArgs {
|
||||
pageId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface WorkspaceTypePublicDocArgs {
|
||||
docId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface WorkspaceTypePublicPageArgs {
|
||||
pageId: Scalars['String']['input'];
|
||||
}
|
||||
@@ -2354,6 +2349,19 @@ export type GetCurrentUserQuery = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type GetDocDefaultRoleQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
docId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetDocDefaultRoleQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
doc: { __typename?: 'DocType'; defaultRole: DocRole };
|
||||
};
|
||||
};
|
||||
|
||||
export type GetInviteInfoQueryVariables = Exact<{
|
||||
inviteId: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -2601,6 +2609,25 @@ export type GetWorkspaceInfoQuery = {
|
||||
workspace: { __typename?: 'WorkspaceType'; team: boolean };
|
||||
};
|
||||
|
||||
export type GetWorkspacePageByIdQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
pageId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspacePageByIdQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
doc: {
|
||||
__typename?: 'DocType';
|
||||
id: string;
|
||||
mode: PublicDocMode;
|
||||
defaultRole: DocRole;
|
||||
public: boolean;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export type GetWorkspacePageMetaByIdQueryVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
pageId: Scalars['String']['input'];
|
||||
@@ -2637,23 +2664,6 @@ export type GetWorkspacePublicByIdQuery = {
|
||||
workspace: { __typename?: 'WorkspaceType'; public: boolean };
|
||||
};
|
||||
|
||||
export type GetWorkspacePublicPageByIdQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
pageId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspacePublicPageByIdQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
publicDoc: {
|
||||
__typename?: 'DocType';
|
||||
id: string;
|
||||
mode: PublicDocMode;
|
||||
} | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type GetWorkspacePublicPagesQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -3056,6 +3066,15 @@ export type UpdateAccountMutation = {
|
||||
};
|
||||
};
|
||||
|
||||
export type UpdateDocDefaultRoleMutationVariables = Exact<{
|
||||
input: UpdateDocDefaultRoleInput;
|
||||
}>;
|
||||
|
||||
export type UpdateDocDefaultRoleMutation = {
|
||||
__typename?: 'Mutation';
|
||||
updateDocDefaultRole: boolean;
|
||||
};
|
||||
|
||||
export type UpdateDocUserRoleMutationVariables = Exact<{
|
||||
input: UpdateDocUserRoleInput;
|
||||
}>;
|
||||
@@ -3398,6 +3417,11 @@ export type Queries =
|
||||
variables: GetCurrentUserQueryVariables;
|
||||
response: GetCurrentUserQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getDocDefaultRoleQuery';
|
||||
variables: GetDocDefaultRoleQueryVariables;
|
||||
response: GetDocDefaultRoleQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getInviteInfoQuery';
|
||||
variables: GetInviteInfoQueryVariables;
|
||||
@@ -3473,6 +3497,11 @@ export type Queries =
|
||||
variables: GetWorkspaceInfoQueryVariables;
|
||||
response: GetWorkspaceInfoQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspacePageByIdQuery';
|
||||
variables: GetWorkspacePageByIdQueryVariables;
|
||||
response: GetWorkspacePageByIdQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspacePageMetaByIdQuery';
|
||||
variables: GetWorkspacePageMetaByIdQueryVariables;
|
||||
@@ -3483,11 +3512,6 @@ export type Queries =
|
||||
variables: GetWorkspacePublicByIdQueryVariables;
|
||||
response: GetWorkspacePublicByIdQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspacePublicPageByIdQuery';
|
||||
variables: GetWorkspacePublicPageByIdQueryVariables;
|
||||
response: GetWorkspacePublicPageByIdQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspacePublicPagesQuery';
|
||||
variables: GetWorkspacePublicPagesQueryVariables;
|
||||
@@ -3790,6 +3814,11 @@ export type Mutations =
|
||||
variables: UpdateAccountMutationVariables;
|
||||
response: UpdateAccountMutation;
|
||||
}
|
||||
| {
|
||||
name: 'updateDocDefaultRoleMutation';
|
||||
variables: UpdateDocDefaultRoleMutationVariables;
|
||||
response: UpdateDocDefaultRoleMutation;
|
||||
}
|
||||
| {
|
||||
name: 'updateDocUserRoleMutation';
|
||||
variables: UpdateDocUserRoleMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user