Skip to content

Commit e134a23

Browse files
committed
Merge branch 'master' into 19.0-release
# Conflicts: # README.md
2 parents 191c3d9 + 5b55a08 commit e134a23

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ system but after that it is up to an implementation about what custom scalars ar
1515

1616
You would use custom scalars when you want to describe more meaningful behavior or ranges of values.
1717

18+
## How to install
1819
To use this library put the following into your gradle config
1920

20-
compile 'com.graphql-java:graphql-java-extended-scalars:19.0'
21+
implementation 'com.graphql-java:graphql-java-extended-scalars:19.0'
2122

2223
or the following into your Maven config
2324

@@ -44,11 +45,22 @@ or the following into your Maven config
4445

4546
It's currently available from Maven Central.
4647

47-
Then register the scalar with graphql-java
48+
## How to use extended scalars
49+
Register the scalar with graphql-java
4850

4951
RuntimeWiring.newRuntimeWiring().scalar(ExtendedScalars.DateTime)
5052

51-
And use it in your schema
53+
Or if using [Spring for GraphQL](https://docs.spring.io/spring-graphql/docs/current/reference/html/), register the scalar with `RuntimeWiringConfigurer`
54+
55+
@Configuration
56+
public class GraphQlConfig {
57+
@Bean
58+
public RuntimeWiringConfigurer runtimeWiringConfigurer() {
59+
return wiringBuilder -> wiringBuilder.scalar(ExtendedScalars.DateTime);
60+
}
61+
}
62+
63+
And use the scalar in your schema
5264

5365
scalar DateTime
5466
type Something {

src/main/java/graphql/scalars/object/ObjectScalar.java

-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ public Object parseLiteral(Object input, Map<String, Object> variables) throws C
6565
"Expected AST type 'Value' but was '" + typeName(input) + "'."
6666
);
6767
}
68-
if (input instanceof NullValue) {
69-
return null;
70-
}
7168
if (input instanceof FloatValue) {
7269
return ((FloatValue) input).getValue();
7370
}

src/test/groovy/graphql/scalars/object/ObjectScalarTest.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class ObjectScalarTest extends Specification {
3737
mkIntValue(666) | 666
3838
mkBooleanValue(true) | true
3939
mkEnumValue("enum") | "enum"
40-
mkNullValue() | null
4140
mkVarRef("varRef1") | "value1"
4241
mkArrayValue([
4342
mkStringValue("s"), mkIntValue(666)

0 commit comments

Comments
 (0)