Skip to content

Commit 59b9759

Browse files
aguilarmfubhy
authored andcommitted
Update filters docs for entity reference fields. (#725)
1 parent fef9b2b commit 59b9759

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

doc/queries/filters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ We can easily filter by this field just by providing its field name and value, t
119119

120120
## Filtering for entity reference fields
121121

122-
Yet another common scenario is we need to filter for a field, but this field is a entity reference meaning that we should provide the key of the entity to be referenced in the value property. In this example lets imagine we have a entity reference in the "Article" entity to a "Client". This field is an entity reference of type node. The way we filter for this field is as followed :
122+
Yet another common scenario is we need to filter for a field, but this field is a entity reference meaning that we should provide the key of the entity to be referenced in the value property. In this example lets imagine we have a entity reference in the "Article" entity to a "Client", via the `field_client` field. This field is an entity reference of type node. The way we filter for this field is as followed :
123123

124124
```
125125
query {
126126
nodeQuery(filter: {conditions: [
127127
{operator: EQUAL, field: "type", value: ["article"]},
128-
{operator: EQUAL, field: "client.entity.nid", value: ["13"]}
128+
{operator: EQUAL, field: "field_client.entity.nid", value: ["13"]}
129129
]}) {
130130
entities {
131131
entityLabel
@@ -134,5 +134,5 @@ query {
134134
}
135135
```
136136

137-
If the entity we are filtering is for example of type "Term reference" then the ``` client.entity.nid ``` should become ``` client.entity.tid ``` as it now should reference a term id and not a node id.
137+
If the entity we are filtering is for example of type "Term reference" then the ``` field_client.entity.nid ``` should become ``` field_client.entity.tid ``` as it now should reference a term id and not a node id.
138138

0 commit comments

Comments
 (0)