diff --git a/examples/configuration/src/index.ts b/examples/configuration/src/index.ts index beb632b..eaa87fa 100644 --- a/examples/configuration/src/index.ts +++ b/examples/configuration/src/index.ts @@ -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); // --------------------------------------------------------------------------- @@ -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)'); } diff --git a/examples/crud-operations/src/schema.ts b/examples/crud-operations/src/schema.ts index b7036bd..a321f11 100644 --- a/examples/crud-operations/src/schema.ts +++ b/examples/crud-operations/src/schema.ts @@ -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 })) diff --git a/examples/multi-driver/src/index.ts b/examples/multi-driver/src/index.ts index ca59e64..0205659 100644 --- a/examples/multi-driver/src/index.ts +++ b/examples/multi-driver/src/index.ts @@ -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.'); diff --git a/examples/relations/src/index.ts b/examples/relations/src/index.ts index 9e448f9..b4abe68 100644 --- a/examples/relations/src/index.ts +++ b/examples/relations/src/index.ts @@ -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('User', { + await client.create('User', { data: { id: 'rel-alice', name: 'Alice', email: 'alice@example.com' }, }); - const bob = await client.create('User', { + await client.create('User', { data: { id: 'rel-bob', name: 'Bob', email: 'bob@example.com' }, }); - const carol = await client.create('User', { + await client.create('User', { data: { id: 'rel-carol', name: 'Carol', email: 'carol@example.com' }, }); - const post = await client.create('Post', { + await client.create('Post', { data: { id: 'rel-post-1', title: 'Hello Graph', published: true }, }); diff --git a/examples/zod-validation/src/index.ts b/examples/zod-validation/src/index.ts index bae0ea6..f4cb375 100644 --- a/examples/zod-validation/src/index.ts +++ b/examples/zod-validation/src/index.ts @@ -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'; // --------------------------------------------------------------------------- @@ -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( diff --git a/packages/sdk/tests/driver-kuzu.test.ts b/packages/sdk/tests/driver-kuzu.test.ts index df43942..18911e2 100644 --- a/packages/sdk/tests/driver-kuzu.test.ts +++ b/packages/sdk/tests/driver-kuzu.test.ts @@ -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;