question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could @GraphQLNonNull be used as an ElementType.METHOD annotation?

See original GitHub issue

Everything 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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
alediaferiacommented, Mar 17, 2019

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.

2reactions
kaqqaocommented, May 3, 2018

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…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found