Skip to content
8 changes: 4 additions & 4 deletions modules/ROOT/pages/directives/autogeneration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following type definition specifies the `id` field as an autogenerated value

[source, graphql, indent=0]
----
type User {
type User @node {
id: ID! @id
username: String!
}
Expand Down Expand Up @@ -70,7 +70,7 @@ The following type definition has two individual fields to store the timestamps

[source, graphql, indent=0]
----
type User {
type User @node {
createdAt: DateTime! @timestamp(operations: [CREATE])
updatedAt: DateTime! @timestamp(operations: [UPDATE])
}
Expand All @@ -80,14 +80,14 @@ The following two equivalent type definitions have a single field storing the ev

[source, graphql, indent=0]
----
type User {
type User @node {
lastModified: DateTime! @timestamp
}
----

[source, graphql, indent=0]
----
type User {
type User @node {
lastModified: DateTime! @timestamp(operations: [CREATE, UPDATE])
}
----
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/directives/custom-directives.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const neoSchema = new Neo4jGraphQL({
typeDefs: [
upperDirectiveTypeDefs,
`#graphql
type Movie {
type Movie @node {
name: String @uppercase
}
`,
Expand Down
38 changes: 19 additions & 19 deletions modules/ROOT/pages/directives/custom-logic.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface Auth {
a| You can use the JWT in the request to return the value of the currently logged in User:
[source, graphql, indent=0]
----
type User {
type User @node {
id: String
}

Expand Down Expand Up @@ -117,7 +117,7 @@ Both approaches are demonstrated here:

[source, graphql, indent=0]
----
type User {
type User @node {
id
}

Expand All @@ -135,7 +135,7 @@ type Query {

[source, graphql, indent=0]
----
type User {
type User @node {
id
}

Expand Down Expand Up @@ -185,13 +185,13 @@ In the following example, the field `similarMovies` is bound to the `Movie` type

[source, graphql, indent=0]
----
type Actor {
type Actor @node {
actorId: ID!
name: String
movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}

type Movie {
type Movie @node {
movieId: ID!
title: String
description: String
Expand All @@ -216,7 +216,7 @@ The following example demonstrates a query to return all of the actors in the da

[source, graphql, indent=0]
----
type Actor {
type Actor @node {
actorId: ID!
name: String
}
Expand All @@ -239,7 +239,7 @@ The following example demonstrates a mutation using a Cypher query to insert a s

[source, graphql, indent=0]
----
type Actor {
type Actor @node {
actorId: ID!
name: String
}
Expand Down Expand Up @@ -291,7 +291,7 @@ enum Status {
ACTIVE
INACTIVE
}
type Movie {
type Movie @node {
status: Status @coalesce(value: ACTIVE)
}
----
Expand Down Expand Up @@ -345,7 +345,7 @@ Take, for instance, this schema:
[source, javascript, indent=0]
----
const typeDefs = `
type User {
type User @node {
firstName: String!
lastName: String!
fullName: String! @customResolver(requires: "firstName lastName")
Expand Down Expand Up @@ -397,13 +397,13 @@ Using a selection set string makes it possible to select fields from related typ
[source, javascript, indent=0]
----
const typeDefs = `
type Address {
type Address @node {
houseNumber: Int!
street: String!
city: String!
}

type User {
type User @node {
id: ID!
firstName: String!
lastName: String!
Expand Down Expand Up @@ -437,7 +437,7 @@ interface Publication {
publicationYear: Int!
}

type Author {
type Author @node {
name: String!
publications: [Publication!]! @relationship(type: "WROTE", direction: OUT)
publicationsWithAuthor: [String!]!
Expand All @@ -446,13 +446,13 @@ type Author {
)
}

type Book implements Publication {
type Book implements Publication @node {
title: String!
publicationYear: Int!
author: [Author!]! @relationship(type: "WROTE", direction: IN)
}

type Journal implements Publication {
type Journal implements Publication @node {
subject: String!
publicationYear: Int!
author: [Author!]! @relationship(type: "WROTE", direction: IN)
Expand All @@ -468,7 +468,7 @@ interface Publication {
publicationYear: Int!
}

type Author {
type Author @node {
name: String!
publications: [Publication!]! @relationship(type: "WROTE", direction: OUT)
publicationsWithAuthor: [String!]!
Expand All @@ -477,13 +477,13 @@ type Author {
)
}

type Book implements Publication {
type Book implements Publication @node {
title: String!
publicationYear: Int!
author: [Author!]! @relationship(type: "WROTE", direction: IN)
}

type Journal implements Publication {
type Journal implements Publication @node {
subject: String!
publicationYear: Int!
author: [Author!]! @relationship(type: "WROTE", direction: IN)
Expand Down Expand Up @@ -525,7 +525,7 @@ Type definitions:

[source, graphql, indent=0]
----
type Product {
type Product @node {
name: String!
slug: String! @populatedBy(callback: "slug", operations: [CREATE, UPDATE])
}
Expand Down Expand Up @@ -561,7 +561,7 @@ For example, if you want a field `modifiedBy`:

[source, graphql, indent=0]
----
type Record {
type Record @node {
content: String!
modifiedBy: @populatedBy(callback: "modifiedBy", operations: [CREATE, UPDATE])
}
Expand Down
Loading