Skip to content

Commit dd84992

Browse files
Remove references to deprecated directives (#11)
Co-authored-by: Lidia Zuin <[email protected]>
1 parent 4ff550b commit dd84992

File tree

5 files changed

+10
-153
lines changed

5 files changed

+10
-153
lines changed

modules/ROOT/pages/introspector.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This tool has full support for generating type definitions, including:
1313
- `@node`
1414
- `label` for mapping where a node label might use a character that's not in the GraphQL supported character set
1515
- `additionalLabels` for nodes that has multiple labels
16-
- Generating a read-only version of the GraphQL type definitions, i.e. generate a `@exclude(operations: [CREATE, DELETE, UPDATE])` directive on all node types.
16+
- Generating a read-only version of the GraphQL type definitions
1717

1818
== Limitations
1919

modules/ROOT/pages/ogm/index.adoc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ Most applications won't just expose a single GraphQL API. There may also be sche
1616

1717
The following directives are excluded from the OGM's schema:
1818

19-
- `@auth`
20-
- `@exclude`
19+
- `@authentication`
20+
- `@authorization`
21+
- `@subscriptionsAuthorization`
2122
- `@private`
22-
- `@readonly`
23-
- `@writeonly`
23+
- `@query`
24+
- `@mutation`
25+
- `@subscription`
26+
- `@filterable`
27+
- `@selectable`
28+
- `@settable`
2429

2530
This is because the OGM is only ever used programmatically, as opposed to an exposed API which needs these security measures.
2631

modules/ROOT/pages/reference/directives/index.adoc

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ The `@alias` directive will map a GraphQL schema field to a Neo4j property on a
77

88
Reference: xref::reference/directives/database-mapping.adoc#type-definitions-alias[`@alias`]
99

10-
== `@auth`
11-
label:deprecated[]
12-
13-
The `@auth` directive is used to define complex fine-grained and role-based access control for object types and fields.
14-
1510
== `@coalesce`
1611

1712
The `@coalesce` directive exposes a mechanism for querying against non-existent, `null` values on a node.
@@ -112,13 +107,6 @@ The `@queryOptions` is to be used on nodes, where applied will inject values int
112107

113108
Reference: xref::reference/directives/default-values.adoc#type-definitions-default-values-queryoptions[`@queryOptions`]
114109

115-
== `@readonly` label:deprecated[]
116-
117-
This directive is deprecated. See the xref:reference/directives/schema-configuration/field-configuration.adoc#_settable[`@settable`] directive.
118-
The `@readonly` directive marks fields as read-only.
119-
120-
Reference: xref::reference/directives/schema-configuration/field-configuration.adoc#_readonly_deprecated[`@readonly`]
121-
122110
== `@relationship`
123111

124112
The `@relationship` directive is used to configure relationships between object types.
@@ -166,12 +154,3 @@ Reference: xref::reference/directives/autogeneration.adoc#type-definitions-autog
166154
The `@unique` directive indicates that there should be a uniqueness constraint in the database for the fields that it is applied to.
167155

168156
Reference: xref::reference/type-definitions/indexes-and-constraints.adoc#type-definitions-constraints-unique[Unique node property constraints]
169-
170-
== `@writeonly` label:deprecated[]
171-
172-
This directive is deprecated.
173-
174-
Use the xref:reference/directives/schema-configuration/field-configuration.adoc#_selectable[`@selectable`] directive instead.
175-
The `@writeonly` directive marks fields as write-only.
176-
177-
Reference: xref::reference/directives/schema-configuration/field-configuration.adoc#_writeonly_deprecated[`@writeonly`]

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

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -153,88 +153,3 @@ type Movie @subscription(operations: [CREATE]) {
153153
length: Int
154154
}
155155
----
156-
157-
== `@exclude` label:deprecated[]
158-
159-
This directive skips the generation of queries and/or subscriptions and/or particular/all mutations for the specified type.
160-
161-
[NOTE]
162-
====
163-
This directive is deprecated.
164-
165-
Use the xref:reference/directives/schema-configuration/type-configuration.adoc#_query[`@query`], xref:reference/directives/schema-configuration/type-configuration.adoc#_mutation[`@mutation`] and the xref:reference/directives/schema-configuration/type-configuration.adoc#_subscription[`@subscription`] directives instead.
166-
====
167-
168-
=== Definition
169-
170-
[source, graphql, indent=0]
171-
----
172-
enum ExcludeOperation {
173-
CREATE
174-
READ
175-
UPDATE
176-
DELETE
177-
SUBSCRIBE
178-
}
179-
180-
"""Instructs @neo4j/graphql to exclude the specified operations from query, mutation and subscription generation. If used without an argument, no queries, mutations or subscriptions will be generated for this type."""
181-
directive @exclude(
182-
operations: [ExcludeOperation!]! = [CREATE, READ, UPDATE, DELETE, SUBSCRIBE]
183-
) on OBJECT
184-
----
185-
186-
=== Usage
187-
188-
==== Disable Query field generation
189-
190-
[source, graphql, indent=0]
191-
----
192-
type User @exclude(operations: [READ]) {
193-
name: String
194-
}
195-
----
196-
197-
==== Disable single Mutation field generation
198-
199-
[source, graphql, indent=0]
200-
----
201-
type User @exclude(operations: [CREATE]) {
202-
name: String
203-
}
204-
----
205-
206-
==== Disable multiple Mutation field generation
207-
208-
[source, graphql, indent=0]
209-
----
210-
type User @exclude(operations: [CREATE, DELETE]) {
211-
name: String
212-
}
213-
----
214-
215-
==== Disable Subscription field generation
216-
217-
[source, graphql, indent=0]
218-
----
219-
type User @exclude(operations: [SUBSCRIBE]) {
220-
name: String
221-
}
222-
----
223-
224-
==== Disable all Query, Mutation, and Subscription field generation
225-
226-
The following two type definitions are equivalent in the sense that no queries, mutations, or subscriptions will be generated for either of them:
227-
228-
[source, graphql, indent=0]
229-
----
230-
type User @exclude {
231-
name: String
232-
}
233-
----
234-
235-
[source, graphql, indent=0]
236-
----
237-
type User @exclude(operations: [CREATE, READ, UPDATE, DELETE, SUBSCRIBE]) {
238-
name: String
239-
}
240-
----

modules/ROOT/pages/reference/type-definitions/interfaces.adoc

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -71,48 +71,6 @@ type Actor {
7171
}
7272
----
7373

74-
==== Overriding
75-
76-
In addition to inheritance, directives can be overridden on a per-implementation basis. Say you had an interface defining some `Content`, with some basic authorization rules:
77-
78-
[source, graphql, indent=0]
79-
----
80-
interface Content
81-
@auth(rules: [{ operations: [CREATE, UPDATE, DELETE], allow: { author: { username: "$jwt.sub" } } }]) {
82-
title: String!
83-
author: [Author!]! @relationship(type: "HAS_CONTENT", direction: IN)
84-
}
85-
86-
type User {
87-
username: String!
88-
content: [Content!]! @relationship(type: "HAS_CONTENT", direction: OUT)
89-
}
90-
----
91-
92-
You might implement this once for public content and once for private content which has additional rules in place:
93-
94-
[source, graphql, indent=0]
95-
----
96-
type PublicContent implements Content {
97-
title: String!
98-
author: [Author!]!
99-
}
100-
101-
type PrivateContent implements Content
102-
@auth(rules: [{ operations: [CREATE, READ, UPDATE, DELETE], allow: { author: { username: "$jwt.sub" } } }]) {
103-
title: String!
104-
author: [Author!]!
105-
}
106-
----
107-
108-
The `PublicContent` type will inherit the auth rules from the `Content` interface, whilst the `PrivateContent` type will use the auth rules specified there.
109-
110-
In summary, there are three choices for the application of directives when using interfaces:
111-
112-
- Directives specified on the interface and inherited by all implementing types when the directives for every type are the same.
113-
- Directives specified on the interface and overridden by certain implementing types when directives are broadly the same with a few discrepancies.
114-
- Directives specified on implementing types alone when there is very little commonality between types, or certain types need a directive and others don't.
115-
11674
[[type-definitions-interfaced-types-querying]]
11775
== Querying an interface
11876

0 commit comments

Comments
 (0)