MCPcopy Create free account
hub / github.com/hashintel/hash / deleteEntities

Function deleteEntities

tests/hash-backend-integration/src/tests/admin-server.ts:64–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 * Delete all entities from the Graph.
63 */
64export const deleteEntities = async () => {
65 await fetch(`http://127.0.0.1:${port}/entities/delete`, {
66 method: "POST",
67 headers: {
68 "Content-Type": "application/json",
69 "X-Authenticated-User-Actor-Id": "00000000-0000-0000-0000-000000000000",
70 },
71 body: JSON.stringify({
72 filter: { all: [] },
73 temporalAxes: {
74 pinned: {
75 axis: "transactionTime",
76 timestamp: null,
77 },
78 variable: {
79 axis: "decisionTime",
80 interval: {
81 start: { kind: "unbounded" },
82 end: null,
83 },
84 },
85 },
86 includeDrafts: true,
87 scope: "erase",
88 }),
89 }).then(async (response) => {
90 if (!response.ok) {
91 const body = await response.text();
92 throw new Error(`Could not remove entities: ${body}`);
93 }
94 });
95};
96
97/**
98 * Restore a snapshot from a file.

Callers 1

resetGraphFunction · 0.85

Calls 3

fetchFunction · 0.85
thenMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected