MCPcopy Index your code
hub / github.com/payloadcms/payload / updateAutoSavePostHelper

Function updateAutoSavePostHelper

test/versions/int.spec.ts:2663–2688  ·  view source on GitHub ↗
({
      id,
      title,
    }: {
      id: number | string
      title: string
    })

Source from the content-addressed store, hash-verified

2661 }
2662
2663 async function updateAutoSavePostHelper({
2664 id,
2665 title,
2666 }: {
2667 id: number | string
2668 title: string
2669 }): Promise<JsonObject> {
2670 const query = `mutation {
2671 updateAutosavePost(id: ${formatGraphQLID(id)}, data: {title: "${title}"}) {
2672 id
2673 title
2674 description
2675 createdAt
2676 updatedAt
2677 _status
2678 }
2679 }`
2680
2681 const result: JsonObject = await restClient
2682 .GRAPHQL_POST({
2683 body: JSON.stringify({ query }),
2684 })
2685 .then((res) => res.json())
2686
2687 return result.data.updateAutosavePost
2688 }
2689
2690 async function getVersionByIDHelper({ id }: { id: number | string }): Promise<JsonObject> {
2691 const query = `query {

Callers 1

int.spec.tsFile · 0.85

Calls 3

formatGraphQLIDFunction · 0.85
GRAPHQL_POSTMethod · 0.80
jsonMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…