You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
As of 2.15.0, specifying a type containing an inline @relation directive, like so:
type Movie {
title: String
year: Int
genres: [Genre] @relation(name: "IN_GENRE", direction: "OUT")
}
Will generate an augmented type like:
type Movie {
title: String
year: Int
genres(
first: Int
offset: Int
orderBy: [_GenreOrdering]
filter: _GenreFilter
): [Genre]
}
But specifying the relation as its own property-containing type, like so:
type Movie {
title: String
year: Int
genres: [GenreRelation]
}
type GenreRelation {
from: Movie
to: Genre
type: String
}
Appears to lose the orderBy functionality with respect to the targeted node type (here, Genre), and only generates:
type Movie {
title: String
year: Int
genres( ### <-- !!! No `Genre` orderBy at relation-level, only works for relation properties !!!
first: Int
offset: Int
orderBy: [_MovieGenreRelationOrdering]
filter: _MovieGenreRelationFilter
): [_MovieGenreRelation]
}
Where _MovieGenreRelationOrdering only provides the capacity to orderBy the properties of the relation itself (above, type_asc and type_desc), but does not provide the ability to orderBy any properties of the relationally targeted Genre type.
Additionally, the resulting _MovieGenreRelation contains no parameters on the targeted Genre key, so AFAICT filtering can't be accomplished at this level, either.
Is this by design? Forcing a tradeoff between a relation's capacity to contain properties and its capacity to order the related target nodes dramatically limits architectural flexibility, and appears to force the splitting into separate queries of any property-containing relations that require filtering / ordering.
The text was updated successfully, but these errors were encountered:
In theory, this test, as described in #481, should cover this case.
Yet in practice when I attempt to structure my queries using this fragment-based approach, I do not see any of the properties from the targeted type included in the relation's orderBy parameter, as described above.
As of
2.15.0
, specifying a type containing an inline@relation
directive, like so:Will generate an augmented type like:
But specifying the relation as its own property-containing type, like so:
Appears to lose the
orderBy
functionality with respect to the targeted node type (here,Genre
), and only generates:Where
_MovieGenreRelationOrdering
only provides the capacity toorderBy
the properties of the relation itself (above,type_asc
andtype_desc
), but does not provide the ability toorderBy
any properties of the relationally targetedGenre
type.Additionally, the resulting
_MovieGenreRelation
contains no parameters on the targetedGenre
key, so AFAICT filtering can't be accomplished at this level, either.Is this by design? Forcing a tradeoff between a relation's capacity to contain properties and its capacity to order the related target nodes dramatically limits architectural flexibility, and appears to force the splitting into separate queries of any property-containing relations that require filtering / ordering.
The text was updated successfully, but these errors were encountered: