-
I have added the @bean definition as suggested here. However, I'm getting this error below during spring boot server startup. I have generated the code from a schema (which contains
Detail error stack The dependency tree related to spring/graphql looks like this.
This is the java file containing the main method.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You seem to be registering the "wrong" bean. The stack trace is clearly complaining about it not being able to find the scalar type. That's because you need to expose that scalar class as a bean. See also this answer. I don't know what that codegen tool generated for you, since I don't have any experience with it. My guess is it generated something like the @Bean
public GraphQLScalarType dateScalar() {
return GraphQLScalarType.newScalar()
.name("Date")
.description("Date type")
.coercing(new DateCoercing())
.build();
} Does that Netflix tool advertise that the generated classes are compatible with the |
Beta Was this translation helpful? Give feedback.
You seem to be registering the "wrong" bean. The stack trace is clearly complaining about it not being able to find the scalar type. That's because you need to expose that scalar class as a bean. See also this answer.
I don't know what that codegen tool generated for you, since I don't have any experience with it. My guess is it generated something like the
DateCoercing
as used below. Not sure how it would do that tbh, since those classes require certain logic that I can't imagine a tool generating for you.