-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class not found error for scalar type like scalar BigInteger #63
Comments
Can you try adding a typeMapping in your codegen config?
|
thanks @srinivasankavitha its working fine. But unit test cases
|
Can you try adding the scalar class to the list of test classes specified in
|
I tried and getting error |
@srinivasankavitha thanks for looking into the issue. I resolved the issue by loading GraphQLRuntimeWiring class since that’s the one that register all the scalars. We don't need to load every scalar. GraphQLRuntimeWiring class will take care of loading all registered scalars. @SpringBootTest(classes = {DgsAutoConfiguration.class, GraphQLRuntimeWiring.class,... }) |
I'm having this same issue with DateTime. I'm adding the scalar class to the list of @SpringBootTest classes. I don't see the GraphQLRuntimeWiring class to add. Any ideas? java.lang.IllegalArgumentException: Cannot construct instance of |
What did you add to your list of classes? You do need to set up the scalar class and add it to runtime wiring as shown here: |
Yes, I'm actually using the ExtendedScalars like so:
I also tried the long-form full implementation as shown in the link you sent, but got the same result. It works fine when running the Application but I can't seem to get it to work in a unit test. I think that it's something along the lines of what @umesh-kushwaha reported originally where it's not being properly registered by the framework, but I can't figure out which class needs to be instantiated. I'm loading the DgsAutoConfiguration.class and my local DateTimeScalar.class. Thank you for your help! |
How does the jackson mapper in DefaultDgsQueryExecutor.kt know about our custom scalar types? I'm having this problem when I try to deserialize the json back to an object using dgsQueryExecutor.executeAndExtractJsonPathAsObject. |
I was able to reproduce this in the java example and created a new issue here. |
Ok, thanks for the details. Will close this issue in that case and look into the new issue you opened. |
Scalar type code generation failed with Class not found error
The text was updated successfully, but these errors were encountered: