MCPcopy Create free account
hub / github.com/Fernanda-Kipper/text-editor / generateCreateQuery

Function generateCreateQuery

src/hooks/useCreateFile.ts:7–19  ·  view source on GitHub ↗
(data: CreateFilePayload)

Source from the content-addressed store, hash-verified

5import { generatePublishQuery } from '../utils/generate-publish-query'
6
7const generateCreateQuery = (data: CreateFilePayload) => `
8 mutation {
9 createFile(data: {
10 title: "${data.title}",
11 body:"${data.body}",
12 slug: "${data.slug}",
13 lastUpdated: "${data.lastUpdated}"
14 }) {
15 slug,
16 id
17 }
18 }
19`
20
21const createAndPublishFile = async (mutation: CreateFilePayload) => {
22 const { createFile } = await customFetcher<CreateFileResponse>(generateCreateQuery(mutation)).then(res => res.data.data);

Callers 1

createAndPublishFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…