Skip to content

Commit abd33e3

Browse files
committed
(deps) Updating to latest graphql-java:17.1
(deps) Adding graphql-java-extended-scalars 17.0 for non-standard scalars (BigInteger, BigDecimal, Char, Byte, Long, Short). Removing GraphQLBatched as the deprecated `BatchedExecutionStrategy` was finally removed from graphql-java
1 parent 110e160 commit abd33e3

File tree

13 files changed

+450
-1
lines changed

13 files changed

+450
-1
lines changed

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ gradle.projectsEvaluated {
5454

5555
dependencies {
5656
compile 'javax.validation:validation-api:1.1.0.Final'
57-
compile 'com.graphql-java:graphql-java:17.0'
57+
compile 'com.graphql-java:graphql-java:17.1'
58+
compile 'com.graphql-java:graphql-java-extended-scalars:17.0'
59+
5860

5961
// OSGi
6062
compileOnly 'org.osgi:org.osgi.core:6.0.0'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
19+
import graphql.schema.GraphQLType;
20+
import java.lang.reflect.AnnotatedType;
21+
import java.math.BigDecimal;
22+
23+
public class BigDecimalFunction implements TypeFunction {
24+
@Override
25+
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
26+
return ExtendedScalars.GraphQLBigDecimal.getName();
27+
}
28+
29+
@Override
30+
public boolean canBuildType(Class<?> aClass, AnnotatedType annotatedType) {
31+
return aClass == BigDecimal.class;
32+
}
33+
34+
@Override
35+
public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) {
36+
return buildType(input, aClass, annotatedType);
37+
}
38+
39+
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
40+
return ExtendedScalars.GraphQLBigDecimal;
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
19+
import graphql.schema.GraphQLType;
20+
import java.lang.reflect.AnnotatedType;
21+
import java.math.BigInteger;
22+
23+
public class BigIntegerFunction implements TypeFunction {
24+
@Override
25+
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
26+
return ExtendedScalars.GraphQLBigInteger.getName();
27+
}
28+
29+
@Override
30+
public boolean canBuildType(Class<?> aClass, AnnotatedType annotatedType) {
31+
return aClass == BigInteger.class;
32+
}
33+
34+
@Override
35+
public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) {
36+
return buildType(input, aClass, annotatedType);
37+
}
38+
39+
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
40+
return ExtendedScalars.GraphQLBigInteger;
41+
}
42+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
19+
import graphql.schema.GraphQLType;
20+
import java.lang.reflect.AnnotatedType;
21+
22+
public class ByteFunction implements TypeFunction {
23+
@Override
24+
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
25+
return ExtendedScalars.GraphQLByte.getName();
26+
}
27+
28+
@Override
29+
public boolean canBuildType(Class<?> aClass, AnnotatedType annotatedType) {
30+
return aClass == Byte.class;
31+
}
32+
33+
@Override
34+
public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) {
35+
return buildType(input, aClass, annotatedType);
36+
}
37+
38+
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
39+
return ExtendedScalars.GraphQLByte;
40+
}
41+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
19+
import graphql.schema.GraphQLType;
20+
import java.lang.reflect.AnnotatedType;
21+
22+
public class CharFunction implements TypeFunction {
23+
24+
@Override
25+
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
26+
return ExtendedScalars.GraphQLChar.getName();
27+
}
28+
29+
@Override
30+
public boolean canBuildType(Class<?> aClass, AnnotatedType annotatedType) {
31+
return aClass == Character.class;
32+
}
33+
34+
@Override
35+
public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) {
36+
return buildType(input, aClass, annotatedType);
37+
}
38+
39+
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
40+
return ExtendedScalars.GraphQLChar;
41+
}
42+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
19+
import graphql.schema.GraphQLType;
20+
import java.lang.reflect.AnnotatedType;
21+
22+
23+
class LongFunction implements TypeFunction {
24+
25+
@Override
26+
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
27+
return ExtendedScalars.GraphQLLong.getName();
28+
}
29+
30+
@Override
31+
public boolean canBuildType(Class<?> aClass, AnnotatedType annotatedType) {
32+
return aClass == Long.class || aClass == long.class;
33+
}
34+
35+
@Override
36+
public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) {
37+
return buildType(input,aClass,annotatedType);
38+
}
39+
40+
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
41+
return ExtendedScalars.GraphQLLong;
42+
}
43+
44+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import graphql.annotations.processor.ProcessingElementsContainer;
18+
import graphql.scalars.ExtendedScalars;
19+
import graphql.schema.GraphQLType;
20+
import java.lang.reflect.AnnotatedType;
21+
22+
public class ShortFunction implements TypeFunction {
23+
@Override
24+
public String getTypeName(Class<?> aClass, AnnotatedType annotatedType) {
25+
return ExtendedScalars.GraphQLShort.getName();
26+
}
27+
28+
@Override
29+
public boolean canBuildType(Class<?> aClass, AnnotatedType annotatedType) {
30+
return aClass == Short.class;
31+
}
32+
33+
@Override
34+
public GraphQLType buildType(boolean input, Class<?> aClass, AnnotatedType annotatedType, ProcessingElementsContainer container) {
35+
return buildType(input, aClass, annotatedType);
36+
}
37+
38+
private GraphQLType buildType(boolean inputType, Class<?> aClass, AnnotatedType annotatedType) {
39+
return ExtendedScalars.GraphQLShort;
40+
}
41+
}
42+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import org.testng.annotations.Test;
18+
19+
import java.math.BigDecimal;
20+
21+
import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction;
22+
import static graphql.scalars.ExtendedScalars.GraphQLBigDecimal;
23+
import static org.testng.Assert.assertEquals;
24+
25+
public class BigDecimalFunctionTests {
26+
@Test
27+
public void buildType_bigDecimalType_returnsGraphQLBigDecimal() {
28+
//arrange
29+
DefaultTypeFunction instance = testedDefaultTypeFunction();
30+
31+
//act+assert
32+
assertEquals(instance.buildType(BigDecimal.class, null, null), GraphQLBigDecimal);
33+
}
34+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction;
18+
import static graphql.scalars.ExtendedScalars.GraphQLBigInteger;
19+
import static org.testng.Assert.assertEquals;
20+
21+
import java.math.BigInteger;
22+
import org.testng.annotations.Test;
23+
24+
public class BigIntegerFunctionTests {
25+
@Test
26+
public void buildType_bigIntegerType_returnsGraphQLBigInteger() {
27+
//arrange
28+
DefaultTypeFunction instance = testedDefaultTypeFunction();
29+
30+
//act+assert
31+
assertEquals(instance.buildType(BigInteger.class, null, null), GraphQLBigInteger);
32+
}
33+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Copyright 2016 Yurii Rashkovskii
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
*/
15+
package graphql.annotations.processor.typeFunctions;
16+
17+
import static graphql.annotations.processor.typeFunctions.DefaultTypeFunctionTestHelper.testedDefaultTypeFunction;
18+
import static graphql.scalars.ExtendedScalars.GraphQLByte;
19+
import static org.testng.Assert.assertEquals;
20+
21+
import org.testng.annotations.Test;
22+
23+
public class ByteFunctionTests {
24+
@Test
25+
public void buildType_byteType_returnsGraphQLByte() {
26+
//arrange
27+
DefaultTypeFunction instance = testedDefaultTypeFunction();
28+
29+
//act+assert
30+
assertEquals(instance.buildType(Byte.class, null,null), GraphQLByte);
31+
}
32+
}

0 commit comments

Comments
 (0)