Skip to content

Commit 6dfeac3

Browse files
committed
Merge branch '5.x' into 6.x
2 parents fcd3ffd + 4728590 commit 6dfeac3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1153
-1112
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,30 @@
66
* xref:getting-started/toolbox.adoc[]
77
88
* *Reference*
9-
10-
* xref:authentication-and-authorization/index.adoc[]
11-
** xref:authentication-and-authorization/configuration.adoc[]
12-
** xref:authentication-and-authorization/authentication.adoc[]
13-
** xref:authentication-and-authorization/authorization.adoc[]
14-
** xref:authentication-and-authorization/impersonation-and-user-switching.adoc[]
15-
** xref:authentication-and-authorization/operations.adoc[]
16-
17-
* Type definitions
18-
** xref:type-definitions/types/index.adoc[]
19-
*** xref:type-definitions/types/scalar.adoc[Scalar]
20-
*** xref:type-definitions/types/temporal.adoc[Temporal]
21-
*** xref:type-definitions/types/spatial.adoc[Spatial]
22-
*** xref:type-definitions/types/interfaces.adoc[Interfaces]
23-
*** xref:type-definitions/types/unions.adoc[Union]
24-
*** xref:type-definitions/types/relationships.adoc[]
25-
** xref:type-definitions/directives/index.adoc[]
26-
*** xref:type-definitions/directives/basics.adoc[]
27-
*** xref:type-definitions/directives/autogeneration.adoc[]
28-
*** xref:type-definitions/directives/custom-directives.adoc[]
29-
*** xref:type-definitions/directives/cypher.adoc[]
30-
*** xref:type-definitions/directives/default-values.adoc[]
31-
*** xref:type-definitions/directives/database-mapping.adoc[]
32-
*** xref:type-definitions/directives/indexes-and-constraints.adoc[]
33-
34-
* xref:schema-configuration/index.adoc[Schema configuration]
35-
** xref:schema-configuration/type-configuration.adoc[]
36-
** xref:schema-configuration/global-configuration.adoc[]
37-
** xref:schema-configuration/field-configuration.adoc[]
9+
* xref:security/index.adoc[]
10+
** xref:security/configuration.adoc[]
11+
** xref:security/authentication.adoc[]
12+
** xref:security/authorization.adoc[]
13+
** xref:security/impersonation-and-user-switching.adoc[]
14+
** xref:security/operations.adoc[]
15+
* xref:types/index.adoc[]
16+
** xref:types/scalar.adoc[Scalar]
17+
** xref:types/temporal.adoc[Temporal]
18+
** xref:types/spatial.adoc[Spatial]
19+
** xref:types/interfaces.adoc[Interfaces]
20+
** xref:types/unions.adoc[Union]
21+
** xref:types/relationships.adoc[]
22+
* xref:directives/index.adoc[]
23+
** xref:directives/database-mapping.adoc[]
24+
25+
** xref:directives/autogeneration.adoc[]
26+
** xref:directives/schema-configuration/index.adoc[]
27+
*** xref:directives/schema-configuration/global-configuration.adoc[]
28+
*** xref:directives/schema-configuration/type-configuration.adoc[]
29+
*** xref:directives/schema-configuration/field-configuration.adoc[]
30+
** xref:directives/indexes-and-constraints.adoc[]
31+
** xref:directives/custom-logic.adoc[]
32+
** xref:directives/custom-directives.adoc[]
3833
3934
* xref:queries-aggregations/index.adoc[Queries and aggregations]
4035
** xref:queries-aggregations/queries.adoc[]
@@ -59,7 +54,6 @@
5954
6055
* *How-To*
6156
62-
* xref:custom-resolvers.adoc[]
6357
* xref:driver-configuration.adoc[]
6458
6559
* *Products*

modules/ROOT/pages/authentication-and-authorization/index.adoc

Lines changed: 0 additions & 13 deletions
This file was deleted.

modules/ROOT/pages/custom-resolvers.adoc

Lines changed: 0 additions & 163 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
[[type-definitions-autogeneration]]
2+
= Autogeneration
3+
:page-aliases: type-definitions/autogeneration.adoc, type-definitions/directives/autogeneration.adoc
4+
:description: This page describes directives used for autogeneration.
5+
6+
7+
This page describes directives used for autogeneration:
8+
9+
[[type-definitions-autogeneration-id]]
10+
== `@id`
11+
12+
This directive marks a field as an identifier for an object type.
13+
This enables autogeneration of IDs for the field.
14+
15+
The format of each generated ID is a UUID generated by https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-randomuuid[randomUUID() function].
16+
The field will not be present in input types for mutations.
17+
18+
It is recommended to use xref::/directives/indexes-and-constraints.adoc#type-definitions-constraints-unique[`@unique`] in conjunction with this to add a unique node property constraint.
19+
20+
=== Definition
21+
22+
[source, graphql, indent=0]
23+
----
24+
"""Indicates that the field is an identifier for the object type."""
25+
directive @id on FIELD_DEFINITION
26+
----
27+
28+
=== Usage
29+
30+
The following type definition specifies the `id` field as an autogenerated value:
31+
32+
[source, graphql, indent=0]
33+
----
34+
type User {
35+
id: ID! @id
36+
username: String!
37+
}
38+
----
39+
40+
[[type-definitions-autogeneration-timestamp]]
41+
== `@timestamp`
42+
43+
This directive marks a field as a timestamp field, which can be used to store timestamps of when particular events happen through the GraphQL API.
44+
45+
[NOTE]
46+
====
47+
These events are triggered and stored at the GraphQL API layer.
48+
Events happening in your database through other routes do not trigger updates of these timestamps.
49+
====
50+
51+
=== Definition
52+
53+
[source, graphql, indent=0]
54+
----
55+
enum TimestampOperation {
56+
CREATE
57+
UPDATE
58+
}
59+
60+
"""Instructs @neo4j/graphql to generate timestamps on particular events, which will be available as the value of the specified field."""
61+
directive @timestamp(
62+
"""Which events to generate timestamps on. Defaults to both create and update."""
63+
operations: [TimestampOperation!]! = [CREATE, UPDATE]
64+
) on FIELD_DEFINITION
65+
----
66+
67+
=== Usage
68+
69+
The following type definition has two individual fields to store the timestamps of create and update events:
70+
71+
[source, graphql, indent=0]
72+
----
73+
type User {
74+
createdAt: DateTime! @timestamp(operations: [CREATE])
75+
updatedAt: DateTime! @timestamp(operations: [UPDATE])
76+
}
77+
----
78+
79+
The following two equivalent type definitions have a single field storing the event timestamp of the last `create` or `update`:
80+
81+
[source, graphql, indent=0]
82+
----
83+
type User {
84+
lastModified: DateTime! @timestamp
85+
}
86+
----
87+
88+
[source, graphql, indent=0]
89+
----
90+
type User {
91+
lastModified: DateTime! @timestamp(operations: [CREATE, UPDATE])
92+
}
93+
----
94+
95+
[[type-definitions-autogeneration-populated-by]]

modules/ROOT/pages/type-definitions/directives/custom-directives.adoc renamed to modules/ROOT/pages/directives/custom-directives.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[type-definitions-custom-directives]]
2-
:description: This page describes how to use custom directives in the Neo4j GraphQL Library.
32
= Custom directives
4-
:page-aliases: type-definitions/custom-directives.adoc
3+
:page-aliases: type-definitions/custom-directives.adoc, type-definitions/directives/custom-directives.adoc
4+
:description: This page describes how to use custom directives in the Neo4j GraphQL Library.
55

66
As of https://www.graphql-tools.com/docs/schema-directives[`@graphql-tools`] version 8, the mechanism for defining and applying custom directives has changed significantly, and this is reflected in the Neo4j GraphQL Library.
77

0 commit comments

Comments
 (0)