Skip to content

Commit 98604b8

Browse files
remove undirected examples
1 parent b5ef1c4 commit 98604b8

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

modules/ROOT/pages/queries-aggregations/aggregations.adoc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,3 @@ query {
180180
}
181181
----
182182

183-
When performing an aggregation on related nodes, the query against the relationship
184-
can be defined as "undirected" by using the argument `directed: false`:
185-
186-
[source, graphql, indent=0]
187-
----
188-
query {
189-
users {
190-
id
191-
postsAggregate(directed: false) {
192-
count
193-
}
194-
}
195-
}
196-
----

modules/ROOT/pages/queries-aggregations/queries.adoc

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,45 +69,3 @@ query {
6969
}
7070
}
7171
----
72-
73-
== Undirected queries
74-
75-
All xref::/types/relationships.adoc[relationships] are created with a direction from one node to another.
76-
By default, all queries follow the direction defined in the relationship.
77-
However, in some cases it is necessary to query for all related nodes, regardless of the direction of the relationship.
78-
This can be achieved with the argument `directed: false`.
79-
80-
For example, the following query should return all User friends, regardless of the direction of the relationship `"FRIENDS_WITH"`:
81-
82-
[source, graphql, indent=0]
83-
----
84-
query {
85-
users {
86-
name
87-
friends: friends(directed: false) {
88-
name
89-
}
90-
}
91-
}
92-
----
93-
94-
In addition, undirected relationships can also be used in the same fashion with connections.
95-
For instance, this query is asking for a list of users and their friends' names with an undirected friendship connection:
96-
97-
[source, graphql, indent=0]
98-
----
99-
query Query {
100-
users {
101-
friendsConnection(directed: false) {
102-
edges {
103-
node {
104-
name
105-
}
106-
}
107-
}
108-
}
109-
}
110-
----
111-
112-
Keep in mind that *undirected relationships are only supported in queries*.
113-
The xref::/types/relationships.adoc#_querydirection[type definitions] for a relationship may define a different behavior, so the `directed` option may not be available in some cases.

0 commit comments

Comments
 (0)