blaze-persistence
blaze-persistence copied to clipboard
Support directives in entity view graphql extension
SmallRye GraphQL and SPQR have out of the box annotation support for directives:
- https://github.com/smallrye/smallrye-graphql/blob/main/server/api/src/main/java/io/smallrye/graphql/api/Directive.java
- https://github.com/leangen/graphql-spqr/blob/master/src/main/java/io/leangen/graphql/annotations/GraphQLDirective.java
It would be nice if we could add an overridable method to GraphQLEntityViewSupportFactory which by default tries to infer directives through these annotations and returns something like a Map<String, String|Map> which we can use to feed directives into the GraphQL model.
It seems SPQR already supports this "out of the box" by annotating the method with @GraphQLInputField(defaultValue = "YOUR DEFAULT"). The input type will then receive the default value.