Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit f5198c0

Browse files
mattmurph9Matt Murphy
andauthored
Fix orderby __typename bug (#42)
Co-authored-by: Matt Murphy <matt@Matts-MacBook-Pro.local>
1 parent 2a1e93b commit f5198c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/translate/translate.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,12 @@ const translateNestedOrderingArgument = ({
14921492
.reduce((temporalSubFields, t) => {
14931493
// temporal type subfields, year, minute, etc.
14941494
const subFieldName = t.name.value;
1495+
1496+
// fix for 'no such field __typename' on orderBy
1497+
// https://github.com/neo4j-graphql/neo4j-graphql-js/issues/581
1498+
if (subFieldName === '__typename') {
1499+
return temporalSubFields;
1500+
}
14951501
if (subFieldName === 'formatted') {
14961502
temporalSubFields.push(
14971503
`${subFieldName}: toString(sortedElement.${fieldName})`

0 commit comments

Comments
 (0)