https://search.maven.org/artifact/io.github.ketiko/graphql-java-custom-scalars
This adds some custom Graphql scalars not found in the standard https://github.com/graphql-java/graphql-java library.
The https://github.com/graphql-java/graphql-java-extended-scalars project already adds many custom scalars. However they do not have a UUID scalar yet. There is a PR to add one, graphql-java/graphql-java-extended-scalars#18.
This project add more scalars not found in either of these projects.
First, register the scalar as a bean.
// GraphqlConfig
@Bean
public GraphQLScalarType registerUuidScalar() {
return CustomScalars.Uuid;
}
Second, include the scalar in your graphql schema file.
# schema.graphqls
scalar UUID