Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { gql } from 'graphql-request';

// Create one or more blocks in a document (dev-only mutation)
export const createDocBlocks = gql`
mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
id
type
parent_block_id
created_at
content {
... on TextBlockContent {
delta_format {
insert {
text
}
attributes {
bold
italic
}
}
alignment
direction
}
... on ListBlockContent {
delta_format {
insert {
text
}
attributes {
bold
italic
}
}
alignment
direction
indentation
}
... on ImageContent {
width
alignment
}
... on VideoContent {
url
width
alignment
}
... on TableContent {
cells {
row_cells {
block_id
}
}
}
... on LayoutContent {
cells {
block_id
}
}
... on NoticeBoxContent {
theme
alignment
direction
}
... on DividerContent {
alignment
direction
}
}
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -92,74 +92,3 @@ export const createDocComment = gql`
}
}
`;

// Create one or more blocks in a document
export const createDocBlocks = gql`
mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
id
type
parent_block_id
created_at
content {
... on TextBlockContent {
delta_format {
insert {
text
}
attributes {
bold
italic
}
}
alignment
direction
}
... on ListBlockContent {
delta_format {
insert {
text
}
attributes {
bold
italic
}
}
alignment
direction
indentation
}
... on ImageContent {
width
alignment
}
... on VideoContent {
url
width
alignment
}
... on TableContent {
cells {
row_cells {
block_id
}
}
}
... on LayoutContent {
cells {
block_id
}
}
... on NoticeBoxContent {
theme
alignment
direction
}
... on DividerContent {
alignment
direction
}
}
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
NoticeBoxTheme,
OperationInput,
TextBlock,
} from '../../../../monday-graphql/generated/graphql/graphql';
} from '../../../../monday-graphql/generated/graphql.dev/graphql';
import { DeltaOperation, UpdateBlockContent, CreateBlock } from './update-doc-tool.schema';

// ─── Helpers ─────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
updateDocBlock,
deleteDocBlock,
createDocBlocks,
updateDocName,
addContentToDocFromMarkdown,
getDocByObjectId,
Expand All @@ -10,20 +9,23 @@ import {
createDocComment,
getDocBlockContent,
} from './update-doc-tool.graphql';
import { createDocBlocks } from './update-doc-tool.graphql.dev';

import {
UpdateDocBlockMutation,
UpdateDocBlockMutationVariables,
DeleteDocBlockMutation,
DeleteDocBlockMutationVariables,
CreateDocBlocksMutation,
CreateDocBlocksMutationVariables,
UpdateDocNameMutation,
UpdateDocNameMutationVariables,
AddContentToDocFromMarkdownMutation,
AddContentToDocFromMarkdownMutationVariables,
GetDocBlockContentQuery,
} from '../../../../monday-graphql/generated/graphql/graphql';
import {
CreateDocBlocksMutation,
CreateDocBlocksMutationVariables,
} from '../../../../monday-graphql/generated/graphql.dev/graphql';
import { ToolInputType, ToolOutputType, ToolType } from '../../../tool';
import { BaseMondayApiTool, createMondayApiAnnotations } from '../base-monday-api-tool';
import { buildUpdateBlockContent, buildCreateBlockInput, applyCommentToDelta } from './update-doc-tool.helpers';
Expand Down Expand Up @@ -269,7 +271,9 @@ COMMENTS:
afterBlockId,
blocksInput: [blockInput],
};
const res = await this.mondayApi.request<CreateDocBlocksMutation>(createDocBlocks, variables);
const res = await this.mondayApi.request<CreateDocBlocksMutation>(createDocBlocks, variables, {
versionOverride: 'dev',
});

const created = res?.create_doc_blocks;
if (!created || created.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ type Documents = {
"\n query SearchItemsDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {\n cross_entity_search(query: $query, limit: $limit, filters: $filters) {\n __typename\n ... on ItemSearchResult {\n data {\n id\n }\n }\n }\n }\n": typeof types.SearchItemsDevDocument,
"\n query SearchDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {\n cross_entity_search(query: $query, limit: $limit, filters: $filters) {\n __typename\n ... on BoardSearchResult {\n entity_type\n data {\n id\n name\n url\n }\n }\n ... on DocSearchResult {\n entity_type\n data {\n id\n name\n }\n }\n }\n }\n": typeof types.SearchDevDocument,
"\n mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {\n batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {\n success\n }\n }\n": typeof types.BatchUndoDocument,
"\n mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {\n create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {\n id\n type\n parent_block_id\n created_at\n content {\n ... on TextBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n }\n ... on ListBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n indentation\n }\n ... on ImageContent {\n width\n alignment\n }\n ... on VideoContent {\n url\n width\n alignment\n }\n ... on TableContent {\n cells {\n row_cells {\n block_id\n }\n }\n }\n ... on LayoutContent {\n cells {\n block_id\n }\n }\n ... on NoticeBoxContent {\n theme\n alignment\n direction\n }\n ... on DividerContent {\n alignment\n direction\n }\n }\n }\n }\n": typeof types.CreateDocBlocksDocument,
"\n query getUserContext {\n me {\n id\n name\n title\n }\n favorites {\n object {\n id\n type\n }\n }\n intelligence {\n relevant_boards(limit: 10) {\n id\n board {\n name\n }\n }\n relevant_people(limit: 10) {\n id\n user {\n name\n }\n }\n }\n }\n": typeof types.GetUserContextDocument,
};
const documents: Documents = {
"\n query SearchItemsDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {\n cross_entity_search(query: $query, limit: $limit, filters: $filters) {\n __typename\n ... on ItemSearchResult {\n data {\n id\n }\n }\n }\n }\n": types.SearchItemsDevDocument,
"\n query SearchDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {\n cross_entity_search(query: $query, limit: $limit, filters: $filters) {\n __typename\n ... on BoardSearchResult {\n entity_type\n data {\n id\n name\n url\n }\n }\n ... on DocSearchResult {\n entity_type\n data {\n id\n name\n }\n }\n }\n }\n": types.SearchDevDocument,
"\n mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {\n batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {\n success\n }\n }\n": types.BatchUndoDocument,
"\n mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {\n create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {\n id\n type\n parent_block_id\n created_at\n content {\n ... on TextBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n }\n ... on ListBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n indentation\n }\n ... on ImageContent {\n width\n alignment\n }\n ... on VideoContent {\n url\n width\n alignment\n }\n ... on TableContent {\n cells {\n row_cells {\n block_id\n }\n }\n }\n ... on LayoutContent {\n cells {\n block_id\n }\n }\n ... on NoticeBoxContent {\n theme\n alignment\n direction\n }\n ... on DividerContent {\n alignment\n direction\n }\n }\n }\n }\n": types.CreateDocBlocksDocument,
"\n query getUserContext {\n me {\n id\n name\n title\n }\n favorites {\n object {\n id\n type\n }\n }\n intelligence {\n relevant_boards(limit: 10) {\n id\n board {\n name\n }\n }\n relevant_people(limit: 10) {\n id\n user {\n name\n }\n }\n }\n }\n": types.GetUserContextDocument,
};

Expand Down Expand Up @@ -52,6 +54,10 @@ export function graphql(source: "\n query SearchDev($query: String!, $limit: In
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {\n batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {\n success\n }\n }\n"): (typeof documents)["\n mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {\n batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {\n success\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {\n create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {\n id\n type\n parent_block_id\n created_at\n content {\n ... on TextBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n }\n ... on ListBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n indentation\n }\n ... on ImageContent {\n width\n alignment\n }\n ... on VideoContent {\n url\n width\n alignment\n }\n ... on TableContent {\n cells {\n row_cells {\n block_id\n }\n }\n }\n ... on LayoutContent {\n cells {\n block_id\n }\n }\n ... on NoticeBoxContent {\n theme\n alignment\n direction\n }\n ... on DividerContent {\n alignment\n direction\n }\n }\n }\n }\n"): (typeof documents)["\n mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {\n create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {\n id\n type\n parent_block_id\n created_at\n content {\n ... on TextBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n }\n ... on ListBlockContent {\n delta_format {\n insert {\n text\n }\n attributes {\n bold\n italic\n }\n }\n alignment\n direction\n indentation\n }\n ... on ImageContent {\n width\n alignment\n }\n ... on VideoContent {\n url\n width\n alignment\n }\n ... on TableContent {\n cells {\n row_cells {\n block_id\n }\n }\n }\n ... on LayoutContent {\n cells {\n block_id\n }\n }\n ... on NoticeBoxContent {\n theme\n alignment\n direction\n }\n ... on DividerContent {\n alignment\n direction\n }\n }\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading
Loading