Skip to content

Commit e9c36e8

Browse files
authored
Add missing code line in indexes and constraints example (#128)
* fix: add missing code line in indexes and constraints example You need to call `getSchema()` before `assertIndexesAndConstraints` * fix: typo in type name
1 parent 90f0706 commit e9c36e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/ROOT/pages/type-definitions/directives/indexes-and-constraints.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ This creates two constraints, one for each field decorated with `@id` and `@uniq
232232
[source, javascript, indent=0]
233233
----
234234
const typeDefs = `#graphql
235-
type Colour {
235+
type Color {
236236
id: ID! @id
237237
hexadecimal: String! @unique
238238
}
@@ -245,5 +245,7 @@ const typeDefs = `#graphql
245245
246246
const neoSchema = new Neo4jGraphQL({ typeDefs, driver });
247247
248+
const schema = await neoSchema.getSchema();
249+
248250
await neoSchema.assertIndexesAndConstraints({ options: { create: true }});
249251
----

0 commit comments

Comments
 (0)