Skip to content

Commit 313b221

Browse files
authored
Merge pull request #67 from dondonz/master
Add Spring for GraphQL instructions
2 parents 95a714e + 2033eae commit 313b221

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
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:18.1'
21+
implementation 'com.graphql-java:graphql-java-extended-scalars:18.1'
2122

2223
or the following into your Maven config
2324

@@ -41,11 +42,22 @@ or the following into your Maven config
4142
4243
It's currently available from Maven Central.
4344

44-
Then register the scalar with graphql-java
45+
## How to use extended scalars
46+
Register the scalar with graphql-java
4547

4648
RuntimeWiring.newRuntimeWiring().scalar(ExtendedScalars.DateTime)
4749

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

5062
scalar DateTime
5163
type Something {

0 commit comments

Comments
 (0)