I am building a graphql schema using graphql-java. Currently I build all the types programmatically and use the following statement to build the schema:
/* Construct the schema */
GraphQLSchema schema = GraphQLSchema.newSchema()
.query(query)
.mutation(mutations)
.additionalTypes(types)
.codeRegistry(codeRegistryBuilder.build())
.build();
I would like to add a custom scalar type for handling JSON objects. All the examples I have seen for adding custom scalar type are using RuntimeWiring. They suggest I should do the following model:
RuntimeWiring buildRuntimeWiring() {
return RuntimeWiring.newRuntimeWiring()
.scalar(CustomScalar)
GraphQLSchema schema = new SchemaGenerator().makeExecutableSchema(registry, runtimeWiring);
Since I am not using RuntimeWiring I am wondering how I can add custom scalar type. I would appreciate your help.
Thanks, Rao