@memorylayerai/sdk 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +487 -18
- package/package.json +1 -1
- package/src/client.ts +12 -0
- package/src/index.ts +15 -0
- package/src/resources/graph.ts +212 -0
- package/src/types.ts +179 -0
- package/tests/graph.test.ts +260 -0
- package/tests/graph.unit.test.ts +513 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { GraphResource } from '../src/resources/graph.js';
|
|
3
|
+
import { HTTPClient } from '../src/http-client.js';
|
|
4
|
+
import { ValidationError } from '../src/errors.js';
|
|
5
|
+
import type { GraphData, NodeDetails, GetNodeEdgesResponse, GraphNode } from '../src/types.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Graph Resource Unit Tests
|
|
9
|
+
*
|
|
10
|
+
* These are true unit tests that mock the HTTP client.
|
|
11
|
+
* They test the GraphResource class in isolation.
|
|
12
|
+
*
|
|
13
|
+
* Requirements: 6.1, 6.2, 6.3, 6.4
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Helper function to create empty graph data
|
|
17
|
+
function createEmptyGraphData(): GraphData {
|
|
18
|
+
return {
|
|
19
|
+
nodes: [],
|
|
20
|
+
edges: [],
|
|
21
|
+
metadata: {
|
|
22
|
+
totalNodes: 0,
|
|
23
|
+
memoryCount: 0,
|
|
24
|
+
documentCount: 0,
|
|
25
|
+
entityCount: 0,
|
|
26
|
+
totalEdges: 0,
|
|
27
|
+
relationshipCount: 0,
|
|
28
|
+
similarityCount: 0,
|
|
29
|
+
},
|
|
30
|
+
pagination: {
|
|
31
|
+
hasMore: false,
|
|
32
|
+
nextCursor: undefined,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Helper function to create a test node
|
|
38
|
+
function createTestNode(id: string, label: string): GraphNode {
|
|
39
|
+
return {
|
|
40
|
+
id,
|
|
41
|
+
type: 'memory',
|
|
42
|
+
label,
|
|
43
|
+
data: {
|
|
44
|
+
status: 'latest',
|
|
45
|
+
createdAt: '2026-01-20T00:00:00Z',
|
|
46
|
+
content: `Content ${id}`,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
describe('GraphResource Unit Tests', () => {
|
|
52
|
+
let graphResource: GraphResource;
|
|
53
|
+
let mockHttpClient: HTTPClient;
|
|
54
|
+
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
// Create mock HTTP client
|
|
57
|
+
mockHttpClient = {
|
|
58
|
+
request: vi.fn(),
|
|
59
|
+
} as unknown as HTTPClient;
|
|
60
|
+
|
|
61
|
+
graphResource = new GraphResource(mockHttpClient);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe('getGraph', () => {
|
|
65
|
+
it('should make correct API request with minimal parameters', async () => {
|
|
66
|
+
const mockResponse = createEmptyGraphData();
|
|
67
|
+
|
|
68
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
69
|
+
|
|
70
|
+
const result = await graphResource.getGraph({
|
|
71
|
+
spaceId: 'test-space-123',
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
75
|
+
method: 'GET',
|
|
76
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
77
|
+
query: {},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
expect(result).toEqual(mockResponse);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should include cursor in query parameters', async () => {
|
|
84
|
+
const mockResponse = createEmptyGraphData();
|
|
85
|
+
|
|
86
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
87
|
+
|
|
88
|
+
await graphResource.getGraph({
|
|
89
|
+
spaceId: 'test-space-123',
|
|
90
|
+
cursor: 'cursor-abc',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
94
|
+
method: 'GET',
|
|
95
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
96
|
+
query: {
|
|
97
|
+
cursor: 'cursor-abc',
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('should include limit in query parameters', async () => {
|
|
103
|
+
const mockResponse = createEmptyGraphData();
|
|
104
|
+
|
|
105
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
106
|
+
|
|
107
|
+
await graphResource.getGraph({
|
|
108
|
+
spaceId: 'test-space-123',
|
|
109
|
+
limit: 50,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
113
|
+
method: 'GET',
|
|
114
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
115
|
+
query: {
|
|
116
|
+
limit: '50',
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('should include node types in query parameters', async () => {
|
|
122
|
+
const mockResponse = createEmptyGraphData();
|
|
123
|
+
|
|
124
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
125
|
+
|
|
126
|
+
await graphResource.getGraph({
|
|
127
|
+
spaceId: 'test-space-123',
|
|
128
|
+
nodeTypes: ['memory', 'document'],
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
132
|
+
method: 'GET',
|
|
133
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
134
|
+
query: {
|
|
135
|
+
nodeTypes: 'memory,document',
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should include relationship types in query parameters', async () => {
|
|
141
|
+
const mockResponse = createEmptyGraphData();
|
|
142
|
+
|
|
143
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
144
|
+
|
|
145
|
+
await graphResource.getGraph({
|
|
146
|
+
spaceId: 'test-space-123',
|
|
147
|
+
relationshipTypes: ['extends', 'updates'],
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
151
|
+
method: 'GET',
|
|
152
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
153
|
+
query: {
|
|
154
|
+
relationshipTypes: 'extends,updates',
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('should include date range in query parameters', async () => {
|
|
160
|
+
const mockResponse = createEmptyGraphData();
|
|
161
|
+
|
|
162
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
163
|
+
|
|
164
|
+
await graphResource.getGraph({
|
|
165
|
+
spaceId: 'test-space-123',
|
|
166
|
+
startDate: '2026-01-01T00:00:00Z',
|
|
167
|
+
endDate: '2026-01-31T23:59:59Z',
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
171
|
+
method: 'GET',
|
|
172
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
173
|
+
query: {
|
|
174
|
+
startDate: '2026-01-01T00:00:00Z',
|
|
175
|
+
endDate: '2026-01-31T23:59:59Z',
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('should include all parameters when provided', async () => {
|
|
181
|
+
const mockResponse = createEmptyGraphData();
|
|
182
|
+
|
|
183
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
184
|
+
|
|
185
|
+
await graphResource.getGraph({
|
|
186
|
+
spaceId: 'test-space-123',
|
|
187
|
+
cursor: 'cursor-abc',
|
|
188
|
+
limit: 50,
|
|
189
|
+
nodeTypes: ['memory'],
|
|
190
|
+
relationshipTypes: ['extends'],
|
|
191
|
+
startDate: '2026-01-01T00:00:00Z',
|
|
192
|
+
endDate: '2026-01-31T23:59:59Z',
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
196
|
+
method: 'GET',
|
|
197
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
198
|
+
query: {
|
|
199
|
+
cursor: 'cursor-abc',
|
|
200
|
+
limit: '50',
|
|
201
|
+
nodeTypes: 'memory',
|
|
202
|
+
relationshipTypes: 'extends',
|
|
203
|
+
startDate: '2026-01-01T00:00:00Z',
|
|
204
|
+
endDate: '2026-01-31T23:59:59Z',
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('should throw ValidationError for missing spaceId', async () => {
|
|
210
|
+
await expect(
|
|
211
|
+
graphResource.getGraph({ spaceId: '' })
|
|
212
|
+
).rejects.toThrow(ValidationError);
|
|
213
|
+
|
|
214
|
+
await expect(
|
|
215
|
+
graphResource.getGraph({ spaceId: ' ' })
|
|
216
|
+
).rejects.toThrow('Space ID is required');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('should not include empty arrays in query parameters', async () => {
|
|
220
|
+
const mockResponse = createEmptyGraphData();
|
|
221
|
+
|
|
222
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
223
|
+
|
|
224
|
+
await graphResource.getGraph({
|
|
225
|
+
spaceId: 'test-space-123',
|
|
226
|
+
nodeTypes: [],
|
|
227
|
+
relationshipTypes: [],
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
231
|
+
method: 'GET',
|
|
232
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
233
|
+
query: {},
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
describe('getNodeDetails', () => {
|
|
239
|
+
it('should make correct API request', async () => {
|
|
240
|
+
const mockResponse: NodeDetails = {
|
|
241
|
+
node: {
|
|
242
|
+
id: 'node-123',
|
|
243
|
+
type: 'memory',
|
|
244
|
+
label: 'Test Memory',
|
|
245
|
+
data: {
|
|
246
|
+
status: 'latest',
|
|
247
|
+
createdAt: '2026-01-20T00:00:00Z',
|
|
248
|
+
content: 'Test content',
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
edges: [],
|
|
252
|
+
connectedNodes: [],
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
256
|
+
|
|
257
|
+
const result = await graphResource.getNodeDetails({
|
|
258
|
+
nodeId: 'node-123',
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
262
|
+
method: 'GET',
|
|
263
|
+
path: '/v1/graph/nodes/node-123',
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
expect(result).toEqual(mockResponse);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it('should throw ValidationError for missing nodeId', async () => {
|
|
270
|
+
await expect(
|
|
271
|
+
graphResource.getNodeDetails({ nodeId: '' })
|
|
272
|
+
).rejects.toThrow(ValidationError);
|
|
273
|
+
|
|
274
|
+
await expect(
|
|
275
|
+
graphResource.getNodeDetails({ nodeId: ' ' })
|
|
276
|
+
).rejects.toThrow('Node ID is required');
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
describe('getNodeEdges', () => {
|
|
281
|
+
it('should make correct API request without filters', async () => {
|
|
282
|
+
const mockResponse: GetNodeEdgesResponse = {
|
|
283
|
+
edges: [],
|
|
284
|
+
connectedNodes: [],
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
288
|
+
|
|
289
|
+
const result = await graphResource.getNodeEdges({
|
|
290
|
+
nodeId: 'node-123',
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
294
|
+
method: 'GET',
|
|
295
|
+
path: '/v1/graph/nodes/node-123/edges',
|
|
296
|
+
query: {},
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
expect(result).toEqual(mockResponse);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('should include edge types in query parameters', async () => {
|
|
303
|
+
const mockResponse: GetNodeEdgesResponse = {
|
|
304
|
+
edges: [],
|
|
305
|
+
connectedNodes: [],
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
309
|
+
|
|
310
|
+
await graphResource.getNodeEdges({
|
|
311
|
+
nodeId: 'node-123',
|
|
312
|
+
edgeTypes: ['extends', 'updates'],
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
316
|
+
method: 'GET',
|
|
317
|
+
path: '/v1/graph/nodes/node-123/edges',
|
|
318
|
+
query: {
|
|
319
|
+
edgeTypes: 'extends,updates',
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
it('should throw ValidationError for missing nodeId', async () => {
|
|
325
|
+
await expect(
|
|
326
|
+
graphResource.getNodeEdges({ nodeId: '' })
|
|
327
|
+
).rejects.toThrow(ValidationError);
|
|
328
|
+
|
|
329
|
+
await expect(
|
|
330
|
+
graphResource.getNodeEdges({ nodeId: ' ' })
|
|
331
|
+
).rejects.toThrow('Node ID is required');
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it('should not include empty arrays in query parameters', async () => {
|
|
335
|
+
const mockResponse: GetNodeEdgesResponse = {
|
|
336
|
+
edges: [],
|
|
337
|
+
connectedNodes: [],
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(mockResponse);
|
|
341
|
+
|
|
342
|
+
await graphResource.getNodeEdges({
|
|
343
|
+
nodeId: 'node-123',
|
|
344
|
+
edgeTypes: [],
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
expect(mockHttpClient.request).toHaveBeenCalledWith({
|
|
348
|
+
method: 'GET',
|
|
349
|
+
path: '/v1/graph/nodes/node-123/edges',
|
|
350
|
+
query: {},
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
describe('getAllGraphPages', () => {
|
|
356
|
+
it('should yield all pages until hasMore is false', async () => {
|
|
357
|
+
const page1: GraphData = {
|
|
358
|
+
nodes: [createTestNode('node-1', 'Node 1')],
|
|
359
|
+
edges: [],
|
|
360
|
+
metadata: {
|
|
361
|
+
totalNodes: 3,
|
|
362
|
+
memoryCount: 3,
|
|
363
|
+
documentCount: 0,
|
|
364
|
+
entityCount: 0,
|
|
365
|
+
totalEdges: 0,
|
|
366
|
+
relationshipCount: 0,
|
|
367
|
+
similarityCount: 0,
|
|
368
|
+
},
|
|
369
|
+
pagination: {
|
|
370
|
+
hasMore: true,
|
|
371
|
+
nextCursor: 'cursor-2',
|
|
372
|
+
},
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
const page2: GraphData = {
|
|
376
|
+
nodes: [createTestNode('node-2', 'Node 2')],
|
|
377
|
+
edges: [],
|
|
378
|
+
metadata: {
|
|
379
|
+
totalNodes: 3,
|
|
380
|
+
memoryCount: 3,
|
|
381
|
+
documentCount: 0,
|
|
382
|
+
entityCount: 0,
|
|
383
|
+
totalEdges: 0,
|
|
384
|
+
relationshipCount: 0,
|
|
385
|
+
similarityCount: 0,
|
|
386
|
+
},
|
|
387
|
+
pagination: {
|
|
388
|
+
hasMore: true,
|
|
389
|
+
nextCursor: 'cursor-3',
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
const page3: GraphData = {
|
|
394
|
+
nodes: [createTestNode('node-3', 'Node 3')],
|
|
395
|
+
edges: [],
|
|
396
|
+
metadata: {
|
|
397
|
+
totalNodes: 3,
|
|
398
|
+
memoryCount: 3,
|
|
399
|
+
documentCount: 0,
|
|
400
|
+
entityCount: 0,
|
|
401
|
+
totalEdges: 0,
|
|
402
|
+
relationshipCount: 0,
|
|
403
|
+
similarityCount: 0,
|
|
404
|
+
},
|
|
405
|
+
pagination: {
|
|
406
|
+
hasMore: false,
|
|
407
|
+
nextCursor: undefined,
|
|
408
|
+
},
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
vi.mocked(mockHttpClient.request)
|
|
412
|
+
.mockResolvedValueOnce(page1)
|
|
413
|
+
.mockResolvedValueOnce(page2)
|
|
414
|
+
.mockResolvedValueOnce(page3);
|
|
415
|
+
|
|
416
|
+
const pages: GraphData[] = [];
|
|
417
|
+
for await (const page of graphResource.getAllGraphPages({
|
|
418
|
+
spaceId: 'test-space-123',
|
|
419
|
+
})) {
|
|
420
|
+
pages.push(page);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
expect(pages).toHaveLength(3);
|
|
424
|
+
expect(pages[0]).toEqual(page1);
|
|
425
|
+
expect(pages[1]).toEqual(page2);
|
|
426
|
+
expect(pages[2]).toEqual(page3);
|
|
427
|
+
|
|
428
|
+
// Verify correct API calls
|
|
429
|
+
expect(mockHttpClient.request).toHaveBeenCalledTimes(3);
|
|
430
|
+
expect(mockHttpClient.request).toHaveBeenNthCalledWith(1, {
|
|
431
|
+
method: 'GET',
|
|
432
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
433
|
+
query: {},
|
|
434
|
+
});
|
|
435
|
+
expect(mockHttpClient.request).toHaveBeenNthCalledWith(2, {
|
|
436
|
+
method: 'GET',
|
|
437
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
438
|
+
query: { cursor: 'cursor-2' },
|
|
439
|
+
});
|
|
440
|
+
expect(mockHttpClient.request).toHaveBeenNthCalledWith(3, {
|
|
441
|
+
method: 'GET',
|
|
442
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
443
|
+
query: { cursor: 'cursor-3' },
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
it('should handle single page result', async () => {
|
|
448
|
+
const page1 = createEmptyGraphData();
|
|
449
|
+
|
|
450
|
+
vi.mocked(mockHttpClient.request).mockResolvedValue(page1);
|
|
451
|
+
|
|
452
|
+
const pages: GraphData[] = [];
|
|
453
|
+
for await (const page of graphResource.getAllGraphPages({
|
|
454
|
+
spaceId: 'test-space-123',
|
|
455
|
+
})) {
|
|
456
|
+
pages.push(page);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
expect(pages).toHaveLength(1);
|
|
460
|
+
expect(pages[0]).toEqual(page1);
|
|
461
|
+
expect(mockHttpClient.request).toHaveBeenCalledTimes(1);
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
it('should preserve filters across pages', async () => {
|
|
465
|
+
const page1: GraphData = {
|
|
466
|
+
...createEmptyGraphData(),
|
|
467
|
+
pagination: {
|
|
468
|
+
hasMore: true,
|
|
469
|
+
nextCursor: 'cursor-2',
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
const page2 = createEmptyGraphData();
|
|
474
|
+
|
|
475
|
+
vi.mocked(mockHttpClient.request)
|
|
476
|
+
.mockResolvedValueOnce(page1)
|
|
477
|
+
.mockResolvedValueOnce(page2);
|
|
478
|
+
|
|
479
|
+
const pages: GraphData[] = [];
|
|
480
|
+
for await (const page of graphResource.getAllGraphPages({
|
|
481
|
+
spaceId: 'test-space-123',
|
|
482
|
+
limit: 10,
|
|
483
|
+
nodeTypes: ['memory'],
|
|
484
|
+
relationshipTypes: ['extends'],
|
|
485
|
+
})) {
|
|
486
|
+
pages.push(page);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
expect(pages).toHaveLength(2);
|
|
490
|
+
|
|
491
|
+
// Verify filters are preserved
|
|
492
|
+
expect(mockHttpClient.request).toHaveBeenNthCalledWith(1, {
|
|
493
|
+
method: 'GET',
|
|
494
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
495
|
+
query: {
|
|
496
|
+
limit: '10',
|
|
497
|
+
nodeTypes: 'memory',
|
|
498
|
+
relationshipTypes: 'extends',
|
|
499
|
+
},
|
|
500
|
+
});
|
|
501
|
+
expect(mockHttpClient.request).toHaveBeenNthCalledWith(2, {
|
|
502
|
+
method: 'GET',
|
|
503
|
+
path: '/v1/graph/spaces/test-space-123',
|
|
504
|
+
query: {
|
|
505
|
+
cursor: 'cursor-2',
|
|
506
|
+
limit: '10',
|
|
507
|
+
nodeTypes: 'memory',
|
|
508
|
+
relationshipTypes: 'extends',
|
|
509
|
+
},
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
});
|
|
513
|
+
});
|