Skip to content
Closed
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 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 @@ -51,7 +51,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 @@ -121,7 +121,7 @@ Both approaches are demonstrated here:

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

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

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

Expand Down Expand Up @@ -189,13 +189,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 @@ -220,7 +220,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 @@ -243,7 +243,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 @@ -295,7 +295,7 @@ enum Status {
ACTIVE
INACTIVE
}
type Movie {
type Movie @node {
status: Status @coalesce(value: ACTIVE)
}
----
Expand Down Expand Up @@ -350,7 +350,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 @@ -402,13 +402,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 @@ -442,7 +442,7 @@ interface Publication {
publicationYear: Int!
}

type Author {
type Author @node {
name: String!
publications: [Publication!]! @relationship(type: "WROTE", direction: OUT)
publicationsWithAuthor: [String!]!
Expand All @@ -451,13 +451,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 @@ -473,7 +473,7 @@ interface Publication {
publicationYear: Int!
}

type Author {
type Author @node {
name: String!
publications: [Publication!]! @relationship(type: "WROTE", direction: OUT)
publicationsWithAuthor: [String!]!
Expand All @@ -482,13 +482,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 @@ -530,7 +530,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 @@ -566,7 +566,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