Skip to content
Merged
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
8 changes: 4 additions & 4 deletions examples/configuration/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const config = defineConfig({

console.log('--- defineConfig ---');
console.log(' schema:', config.schema);
console.log(' output.directory:', config.output!.directory);
console.log(' output.zod:', config.output!.zod);
console.log(' driver.type:', config.driver!.type);
console.log(' output.directory:', config.output?.directory);
console.log(' output.zod:', config.output?.zod);
console.log(' driver.type:', config.driver?.type);
console.log(' debug:', config.debug);

// ---------------------------------------------------------------------------
Expand All @@ -47,7 +47,7 @@ console.log('\n--- loadConfig ---');
const loaded = await loadConfig('./graph.config.ts');
if (loaded) {
console.log(' loaded schema:', loaded.schema);
console.log(' loaded driver type:', loaded.driver!.type);
console.log(' loaded driver type:', loaded.driver?.type);
} else {
console.log(' no config file found (skipped)');
}
Expand Down
2 changes: 1 addition & 1 deletion examples/crud-operations/src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// schema.ts - CRUD example schema
import { date, node, number, relation, schema as sch, string } from '@graph-kit/sdk';
import { date, node, number, schema as sch, string } from '@graph-kit/sdk';

export const User = node('User')
.add('id', string({ primary: true }))
Expand Down
1 change: 1 addition & 0 deletions examples/multi-driver/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async function main() {

console.log('\n--- createDriver registry ---');
const { createDriver } = await import('@graph-kit/sdk/driver');
void createDriver; // keeps the dynamic import (and its factory) as a live check
console.log('drivers available via the createDriver() factory');

console.log('\nMulti-driver example complete.');
Expand Down
8 changes: 4 additions & 4 deletions examples/relations/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ async function main() {
try {
await client.raw("MATCH (n) WHERE n.id STARTS WITH 'rel-' DETACH DELETE n");

const alice = await client.create<UserRow>('User', {
await client.create<UserRow>('User', {
data: { id: 'rel-alice', name: 'Alice', email: 'alice@example.com' },
});
const bob = await client.create<UserRow>('User', {
await client.create<UserRow>('User', {
data: { id: 'rel-bob', name: 'Bob', email: 'bob@example.com' },
});
const carol = await client.create<UserRow>('User', {
await client.create<UserRow>('User', {
data: { id: 'rel-carol', name: 'Carol', email: 'carol@example.com' },
});
const post = await client.create<PostRow>('Post', {
await client.create<PostRow>('Post', {
data: { id: 'rel-post-1', title: 'Hello Graph', published: true },
});

Expand Down
3 changes: 1 addition & 2 deletions examples/zod-validation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Does NOT require a database.

import { date, node, number, schema as sch, string } from '@graph-kit/sdk';
import { toCreateSchema, toUpdateSchema, validateCreate, validateUpdate } from '@graph-kit/zod';
import { toCreateSchema, validateCreate, validateUpdate } from '@graph-kit/zod';
import type { z } from 'zod';

// ---------------------------------------------------------------------------
Expand All @@ -25,7 +25,6 @@ const graph = sch().add('User', User).build();
// ---------------------------------------------------------------------------

const createSchema = toCreateSchema(User);
const updateSchema = toUpdateSchema(User);

// Custom Zod refinement: email must contain "@"
const createSchemaWithRefine = createSchema.refine(
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/tests/driver-kuzu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const fake = vi.hoisted(() => {

// Like the real package: parameters only go through prepare and execute
class FakeConnection {
constructor(_db: unknown) {}
async query(cypher: string) {
state.statements.push({ cypher });
if (state.queryError) throw state.queryError;
Expand Down
Loading