Skip to content

Commit 5e4c85c

Browse files
authored
fix: disable default order by for batched queries (#258)
* fix: disable default order by for batched queries * fix: tracing instrumentation test
1 parent bae2652 commit 5e4c85c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaQueryFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
import com.introproventures.graphql.jpa.query.schema.impl.EntityIntrospector.EntityIntrospectionResult.AttributePropertyDescriptor;
8282
import com.introproventures.graphql.jpa.query.schema.impl.PredicateFilter.Criteria;
8383
import com.introproventures.graphql.jpa.query.support.GraphQLSupport;
84+
8485
import graphql.GraphQLException;
8586
import graphql.execution.MergedField;
8687
import graphql.execution.ValuesResolver;
@@ -419,7 +420,8 @@ protected TypedQuery<Object[]> getBatchQuery(DataFetchingEnvironment environment
419420
);
420421

421422
// optionally add default ordering
422-
mayBeAddDefaultOrderBy(query, join, cb);
423+
// FIXME need to extract correct id attribute from collection entity
424+
// mayBeAddDefaultOrderBy(query, join, cb);
423425

424426
return entityManager.createQuery(query.distinct(isDistinct));
425427
}
@@ -1576,7 +1578,7 @@ else if (FloatValue.class.isInstance(value)) {
15761578
return (T) FloatValue.class.cast(value).getValue();
15771579
}
15781580
else if (NullValue.class.isInstance(value)) {
1579-
return (T) null;
1581+
return null;
15801582
}
15811583

15821584
throw new IllegalArgumentException("Not supported");

graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContextFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void testInstrumentationDisabled() {
198198
ExecutionResult result = executor.execute(query);
199199

200200
// then
201-
assertThat(result.getExtensions()).isNull();
201+
assertThat(result.getExtensions().get("tracing")).isNull();
202202
}
203203

204204
}

0 commit comments

Comments
 (0)