Skip to content

Commit 5bb92cb

Browse files
rsill-neo4jmjfwebblidiazuin
authored
Apply suggestions from code review
Co-authored-by: Michael Webb <28074382+mjfwebb@users.noreply.github.com> Co-authored-by: Lidia Zuin <102308961+lidiazuin@users.noreply.github.com>
1 parent 0396a82 commit 5bb92cb

File tree

6 files changed

+80
-14
lines changed

6 files changed

+80
-14
lines changed

modules/ROOT/pages/directives/database-mapping.adoc

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,28 @@ Each type in your GraphQL type definitions can be mapped to an entity in your Ne
1212

1313
=== Definition
1414

15-
// tba
15+
[source, graphql, indent=0]
16+
----
17+
"""
18+
Instructs @neo4j/graphql to treat this field as a relationship. Opens up the ability to create and connect on this field.
19+
"""
20+
directive @relationship(
21+
type: String!
22+
"""Valid and default directions for this relationship."""
23+
queryDirection: RelationshipQueryDirection = DEFAULT_DIRECTED
24+
direction: RelationshipDirection!
25+
"""
26+
The name of the interface containing the properties for this relationship.
27+
"""
28+
properties: String
29+
"""
30+
Prevent all but these operations from being generated for this relationship
31+
"""
32+
nestedOperations: [RelationshipNestedOperations!]! = [CREATE, UPDATE, DELETE, CONNECT, DISCONNECT, CONNECT_OR_CREATE]
33+
"""Prevent aggregation for this relationship"""
34+
aggregate: Boolean = true
35+
) on FIELD_DEFINITION
36+
----
1637

1738
=== Usage
1839

@@ -37,11 +58,11 @@ type Actor {
3758
[NOTE]
3859
====
3960
The `@relationship` directive is used twice, once on each end of the relationship.
40-
This is the standard way of modeling a relationship with the GraphQL library.
41-
However, it is not a requirement of the type definitions themselves and relationships can deliberately be underspecified, for example to limit access through the API layer.
61+
This is the standard way of modeling a relationship with the GraphQL Library.
62+
However, it is not a requirement of the type definitions themselves as relationships can deliberately be underspecified, for example to limit access through the API layer.
4263
====
4364

44-
Also see xref::/directives/schema-configuration/field-configuration/#_relationship[`@relationship` field configuration].
65+
See also: xref::/directives/schema-configuration/field-configuration/#_relationship[`@relationship` field configuration].
4566

4667
== `@relationshipProperties`
4768

@@ -86,7 +107,14 @@ For more information, see xref::/types/relationships.adoc[Type definitions -> Re
86107

87108
=== Definition
88109

89-
// tba
110+
[source, graphql, indent=0]
111+
----
112+
"""Informs @neo4j/graphql of node metadata"""
113+
directive @node(
114+
"""The labels to map this GraphQL type to in the Neo4j database"""
115+
labels: [String!]
116+
) on OBJECT
117+
----
90118

91119
=== Usage
92120

@@ -254,7 +282,16 @@ await startStandaloneServer(server, {
254282

255283
=== Definition
256284

257-
// tba
285+
[source, graphql, indent=0]
286+
----
287+
"""
288+
Instructs @neo4j/graphql to map a GraphQL field to a Neo4j node or relationship property.
289+
"""
290+
directive @alias(
291+
"""The name of the Neo4j property"""
292+
property: String!
293+
) on FIELD_DEFINITION
294+
----
258295

259296
=== Usage
260297

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ query {
170170

171171
=== Definition
172172

173-
Unique node property constraints map to `@unique` directives used in your type definitions, which has the following definition:
173+
Unique node property constraints map to `@unique` directives used in your type definitions.
174+
They have the following definition:
174175

175176
[source, graphql, indent=0]
176177
----
@@ -181,8 +182,9 @@ directive @unique(
181182
) on FIELD_DEFINITION
182183
----
183184

184-
Using this directive does not automatically ensure the existence of these constraints, and you will need to run a function on server startup.
185-
See the section xref::/directives/indexes-and-constraints.adoc#_asserting_constraints[Asserting constraints] for details.
185+
Using this directive does not automatically ensure the existence of these constraints.
186+
Run a function on server startup.
187+
See section xref::/directives/indexes-and-constraints.adoc#_asserting_constraints[Asserting constraints] for details.
186188

187189
=== Usage
188190

modules/ROOT/pages/directives/schema-configuration/type-configuration.adoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,16 @@ type SomeType {
188188

189189
=== Definition
190190

191-
// tba
191+
[source, graphql, indent=0]
192+
----
193+
"""
194+
Instructs @neo4j/graphql to use the given value as the plural of the type name
195+
"""
196+
directive @plural(
197+
"""The value to use as the plural of the type name."""
198+
value: String!
199+
) on OBJECT | INTERFACE | UNION
200+
----
192201

193202
=== Usage
194203

modules/ROOT/pages/security/authorization.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ They use predicates to evaluate the data accessed by the Cypher generated from a
77

88
All authorization rules have an implied requirement for authentication, given that the rules are normally evaluated against values in the JWT payload.
99

10-
In the case of explicit authentication, configured using the xref::/security/authentication.adoc#_authentication[`@authentication`] directive, it is only ever evaluated during Cypher translation time.
10+
In the case of explicit authentication, configured using the xref::/security/authentication.adoc#_authentication[`@authentication`] directive, it is only evaluated during Cypher translation time.
1111
Unauthenticated requests with queries requiring authentication never reach the database.
1212

1313
== `@authorization`

modules/ROOT/pages/security/configuration.adoc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,13 @@ Filtering can be configured for additional JWT claims using the `@jwt` directive
150150

151151
==== Definition
152152

153-
// tba
153+
[source, graphql, indent=0]
154+
----
155+
"""
156+
Instructs @neo4j/graphql that the flagged object represents the relevant JWT payload
157+
"""
158+
directive @jwt on OBJECT
159+
----
154160

155161
==== Usage
156162

@@ -173,7 +179,18 @@ You can use any name as long as it is decorated with the `@jwt` directive.
173179

174180
==== Definition
175181

176-
// tba
182+
[source, graphql, indent=0]
183+
----
184+
"""
185+
Instructs @neo4j/graphql that the flagged field has a mapped path within the JWT Payload.
186+
"""
187+
directive @jwtClaim(
188+
"""
189+
The path of the field in the real JWT as mapped within the JWT Payload.
190+
"""
191+
path: String!
192+
) on FIELD_DEFINITION
193+
----
177194

178195
==== Usage
179196

modules/ROOT/pages/security/subscriptions-authorization.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Subscriptions require their own authorization rules, which are configured with t
66

77
== `@subscriptionsAuthorization`
88

9-
Rules for subscriptions authorization are different to normal authorization rules because only filtering rules are available for subscriptions events and subscriptions events have more limitations in how they can be filtered.
9+
Rules for subscriptions authorization are different to normal authorization rules.
10+
Only filtering rules are available for subscriptions events and there are more limitations in how they can be filtered.
1011

1112
All subscriptions authorization rules have an implied requirement for authentication, given that the rules are normally evaluated against values in the JWT payload.
1213

0 commit comments

Comments
 (0)