Could @GraphQLNonNull be used as an ElementType.METHOD annotation?
See original GitHub issueEverything is working great in our project with SPQR except for required fields : we’re using Kotlin so getters/setters are generated, which makes it impossible to put the @GraphQLNonNull
as parameter annotations.
Would it be possible to use this annotation as ElementType.METHOD
?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Kotlin data class with use-site target annotation on type and ...
Your first solution will only compile the annotations into @kotlin.Metadata where they are not visible to a Java library that is not aware...
Read more >leangen/graphql-spqr - Gitter
I use lombok to generate my getters and setters, and it handles this for me as far ... Although the @GraphQLNonNull annotation has...
Read more >ElementType (Java Platform SE 8 ) - Oracle Help Center
For example, an annotation whose type is meta-annotated with @Target(ElementType.FIELD) may only be written as a modifier for a field declaration.
Read more >GraphQLNonNull (GraphQL SPQR 0.9.7 API) - javadoc.io
Annotation Type GraphQLNonNull. @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) public @interface GraphQLNonNull. Skip navigation links.
Read more >Java - @Target Annotations - GeeksforGeeks
@Target({ElementType.METHOD, ElementType.PACKAGE}) @interface CustomAnnotation {}. The custom annotation created above can be used to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, I’ve created an example schema transformer that infers nullability information from Kotlin runtime.
You can have a look here: https://github.com/alediaferia/graphql-spqr-kotlin-example/blob/master/src/main/kotlin/com/alediaferia/graphql/spqr/kotlin/KotlinTypesSchemaTransformer.kt
Have a look at the tests to better understand what it does.
@kaqqao let me know if there’s anything you want me to include in the example and BTW: awesome work with this library, it’s very well organized.
Interestingly enough, so many people have been complaining about this recently (I like to believe it’s because of SPQR) that it finally attracted some attention from JetBrains. We even got a response from the assigned developer saying that he’ll try implementing it in the next full release of Kotlin! Please do vote and comment on those issues! It seems to be helping…