When resolving an ember model object graph, objects that contain relationships that itself contain relationships with the same name do not get resolved.
Example:
+-- angle
+-- id
+-- title
+-- details
+-- angleTeamMemberships
| +-- id
| +-- name
| +-- avatar
+-- geographies
| +-- id
| +-- name
| +-- code
+-- angleCompanies
| +-- id
| +-- alphaCompany
| | +-- id
| | +-- name
| +-- aliasCompany
| | +-- id
| | +-- name
+-- subAngles
+-- id
+-- title
+-- details
+-- angleTeamMemberships (missing)
| +-- id
| +-- name
| +-- avatar
+-- geographies (missing)
| +-- id
| +-- name
| +-- code
+-- angleCompanies (missing)
+-- id
+-- alphaCompany
| +-- id
| +-- name
+-- aliasCompany
+-- id
+-- name
Given the angle object graph above, a sub-angles's relationships (angleTeamMemberships, geographies, angleCompanies) are missing from the response of an angle's graphql query.
Root problem
The ember-graphql-adatper keeps track of visited relationships by the relationship name. If it encounters the same relationship name again, it will not walk down that path when parsing and building the ember object graph. This results in a generated graphql query with child relationships missing relationships.
Solution
Extend the options of the ember model definition with resolveAlways. When the parser encounters this option, it will traverse this relationship even if it has already been visited.
Problem
When resolving an ember model object graph, objects that contain relationships that itself contain relationships with the same name do not get resolved. Example:
Given the angle object graph above, a sub-angles's relationships (angleTeamMemberships, geographies, angleCompanies) are missing from the response of an angle's graphql query.
Root problem
The
ember-graphql-adatper
keeps track ofvisited
relationships by the relationship name. If it encounters the same relationship name again, it will not walk down that path when parsing and building the ember object graph. This results in a generated graphql query with child relationships missing relationships.Solution
Extend the options of the ember model definition with
resolveAlways
. When the parser encounters this option, it will traverse this relationship even if it has already beenvisited
.