nullableFieldStyle

val nullableFieldStyle: JavaNullable

The style to use for fields that are nullable in the Java generated code.

Only valid when targetLanguage is TargetLanguage.JAVA

Acceptable values:

  • none: Fields will be generated with the same type whether they are nullable or not

  • apolloOptional: Fields will be generated as Apollo's com.apollographql.apollo3.api.Optional<Type> if nullable, or Type if not.

  • javaOptional: Fields will be generated as Java's java.util.Optional<Type> if nullable, or Type if not.

  • guavaOptional: Fields will be generated as Guava's com.google.common.base.Optional<Type> if nullable, or Type if not.

  • jetbrainsAnnotations: Fields will be generated with Jetbrain's org.jetbrains.annotations.Nullable annotation if nullable, or org.jetbrains.annotations.NotNull if not.

  • androidAnnotations: Fields will be generated with Android's androidx.annotation.Nullable annotation if nullable, or androidx.annotation.NonNull if not.

  • jsr305Annotations: Fields will be generated with JSR 305's javax.annotation.Nullable annotation if nullable, or javax.annotation.Nonnull if not.

Default: none