Skip to content

Commit 4dfadc0

Browse files
author
Victor LOIZEL
committed
Switch on ExtendedScalars.Object instead of our custom objectGraphQLScalarType
1 parent a7bbbf3 commit 4dfadc0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
<artifactId>spring-boot-starter-web</artifactId>
2626
</dependency>
2727

28+
<dependency>
29+
<groupId>com.graphql-java</groupId>
30+
<artifactId>graphql-java-extended-scalars</artifactId>
31+
<version>18.1</version>
32+
</dependency>
33+
2834
<dependency>
2935
<groupId>org.springframework.boot</groupId>
3036
<artifactId>spring-boot-starter-test</artifactId>

src/main/java/issue/spring/graphql/objectlist/GraphQlConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package issue.spring.graphql.objectlist;
22

3+
import graphql.scalars.ExtendedScalars;
34
import graphql.schema.*;
45
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
56
import org.springframework.context.annotation.Bean;
@@ -37,7 +38,8 @@ public Object parseLiteral(Object input) throws CoercingParseLiteralException {
3738
public GraphQlSourceBuilderCustomizer sourceBuilderCustomizer(GraphQLScalarType objectGraphQLScalarType) {
3839
return (graphQlSourceBuilder) -> graphQlSourceBuilder
3940
.configureRuntimeWiring((wiringBuilder) -> wiringBuilder
40-
.scalar(objectGraphQLScalarType));
41+
.scalar(ExtendedScalars.Object));
42+
//.scalar(objectGraphQLScalarType));
4143
}
4244
}
4345

src/test/java/issue/spring/graphql/objectlist/BusinessEntityControllerTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package issue.spring.graphql.objectlist;
22

3+
import graphql.scalars.ExtendedScalars;
34
import org.junit.jupiter.api.Test;
45
import org.springframework.beans.factory.annotation.Autowired;
56
import org.springframework.boot.test.autoconfigure.graphql.GraphQlTest;
@@ -37,6 +38,10 @@ void filterValueIsInstanceOfList_stringValue() {
3738
/**
3839
* There is no {@link Exception} with an array of 2 {@link String} declared directly in the GraphQL query,
3940
* we have an {@link graphql.language.ArrayValue} in {@link Object}, shall we have a List instead ?
41+
*
42+
* UPDATE: after switching on {@link ExtendedScalars} object type we have the exception on both test
43+
* (`filterValueIsInstanceOfList_withoutVariables` and `filterValueIsInstanceOfList_withException`),
44+
* it is more coherent.
4045
*/
4146
@Test
4247
void filterValueIsInstanceOfList_withoutVariables() {

0 commit comments

Comments
 (0)