From 90b38edc01bcd757e290b3c3405d1bcbe5c4aaaa Mon Sep 17 00:00:00 2001 From: Igor Dianov Date: Wed, 8 Apr 2020 23:13:40 -0700 Subject: [PATCH 1/2] fix: disable default order by for batched queries --- .../jpa/query/schema/impl/GraphQLJpaQueryFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaQueryFactory.java b/graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaQueryFactory.java index 59f15a486..a5220a99d 100644 --- a/graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaQueryFactory.java +++ b/graphql-jpa-query-schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaQueryFactory.java @@ -81,6 +81,7 @@ import com.introproventures.graphql.jpa.query.schema.impl.EntityIntrospector.EntityIntrospectionResult.AttributePropertyDescriptor; import com.introproventures.graphql.jpa.query.schema.impl.PredicateFilter.Criteria; import com.introproventures.graphql.jpa.query.support.GraphQLSupport; + import graphql.GraphQLException; import graphql.execution.MergedField; import graphql.execution.ValuesResolver; @@ -419,7 +420,8 @@ protected TypedQuery getBatchQuery(DataFetchingEnvironment environment ); // optionally add default ordering - mayBeAddDefaultOrderBy(query, join, cb); + // FIXME need to extract correct id attribute from collection entity + // mayBeAddDefaultOrderBy(query, join, cb); return entityManager.createQuery(query.distinct(isDistinct)); } @@ -1576,7 +1578,7 @@ else if (FloatValue.class.isInstance(value)) { return (T) FloatValue.class.cast(value).getValue(); } else if (NullValue.class.isInstance(value)) { - return (T) null; + return null; } throw new IllegalArgumentException("Not supported"); From 5aeeb79ff7edc2a9ed225fa97890ad174f148c36 Mon Sep 17 00:00:00 2001 From: Igor Dianov Date: Wed, 8 Apr 2020 23:29:12 -0700 Subject: [PATCH 2/2] fix: tracing instrumentation test --- .../query/schema/impl/GraphQLJpaExecutorContextFactoryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContextFactoryTest.java b/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContextFactoryTest.java index e910369df..623c70525 100644 --- a/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContextFactoryTest.java +++ b/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaExecutorContextFactoryTest.java @@ -198,7 +198,7 @@ public void testInstrumentationDisabled() { ExecutionResult result = executor.execute(query); // then - assertThat(result.getExtensions()).isNull(); + assertThat(result.getExtensions().get("tracing")).isNull(); } }