Closed sura2k closed 3 weeks ago
I think what you need is a GraphQLDirective, like so: https://www.graphql-java.com/documentation/sdl-directives/#declaring-directives. However, I'm not sure how this ties into GraphQL SPQR, @kaqqao any thoughts?
@Balf @kaqqao After analyzing the code, I was able to get it done.
class CustomScalarMapper extends CachingMapper<>{}
by overriding the super methodsclass CustomScalars {}
which contains my java.util.Date
scalar with custom date formattingCustomScalars
via CustomScalarMapper
methods to keep it similar to the style used in the library@Autowired
private GraphQLSchemaGenerator schemaGenerator;
schemaGenerator.withTypeMappersPrepended(new CustomScalarMapper()); //Before adding to exising `ScalarMapper` is required I guess
Since I don't have access to post anything to outside repos from my working computer, posting just only the steps from my personal computer. Hope this approach is valid.
Thanks!
Is there a way to format the output Date format to something such as "yyyyMMdd" overriding the default "yyyy-MM-dd"?