public class MappingContext extends java.lang.Object implements GraphQLCodegenConfiguration
Modifier and Type | Class and Description |
---|---|
static class |
MappingContext.Builder
Builder of the mapping context
|
Modifier and Type | Method and Description |
---|---|
static MappingContext.Builder |
builder() |
java.lang.Boolean |
getAddGeneratedAnnotation()
Specifies whether generated classes should be annotated with @Generated
|
ApiInterfaceStrategy |
getApiInterfaceStrategy()
Specifies the strategy of generating api interfaces.
|
java.lang.String |
getApiNamePrefix()
Sets the prefix for GraphQL api classes (query, mutation, subscription).
|
ApiNamePrefixStrategy |
getApiNamePrefixStrategy()
Sets prefix strategy for GraphQL api classes (query, mutation, subscription).
|
java.lang.String |
getApiNameSuffix()
Sets the suffix for GraphQL api classes (query, mutation, subscription).
|
java.lang.String |
getApiPackageName()
Java package for generated api classes (Query, Mutation, Subscription).
|
java.lang.String |
getApiReturnListType()
Return type for api methods (query / subscription) that return list values
For example: reactor.core.publisher.Flux
|
java.lang.String |
getApiReturnType()
Return type for api methods (query / subscription)
For example: reactor.core.publisher.Mono
|
ApiRootInterfaceStrategy |
getApiRootInterfaceStrategy()
Specifies the strategy of generating root api interface.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getCustomAnnotationsMapping()
Can be used to supply custom annotations (serializers) for scalars.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomTemplates()
Can be used to supply paths to custom FreeMarker templates for code generation.
|
java.io.File |
getCustomTemplatesRoot()
Can be used to specify the root directory for the custom FreeMaker templates
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomTypesMapping()
Can be used to supply custom mappings for scalars.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getDirectiveAnnotationsMapping()
Map GraphQL directives to Java annotations.
|
ExtendedDocument |
getDocument() |
java.util.Set<java.lang.String> |
getEnumImportItSelfInScala() |
java.util.Set<java.lang.String> |
getFieldNamesWithResolvers()
Get names of all the fields that require separate resolver class.
|
java.util.Set<java.lang.String> |
getFieldsToExcludeFromGeneration()
Fields that WILL NOT be generated.
|
java.util.Set<java.lang.String> |
getFieldsWithoutResolvers()
Fields that DO NOT require Resolvers.
|
java.util.Set<java.lang.String> |
getFieldsWithResolvers()
Fields that require Resolvers.
|
java.lang.Boolean |
getGenerateAllMethodInProjection()
Enables the generation of the all$ method in the projection classes of the client.
|
java.lang.Boolean |
getGenerateApis()
Specifies whether api classes should be generated.
|
java.lang.Boolean |
getGenerateApisWithSuspendFunctions()
Whether signatures of API interface methods should have
suspend modifier. |
java.lang.Boolean |
getGenerateApisWithThrowsException()
Whether signatures of API interface methods should have
throws Exception . |
java.lang.Boolean |
getGenerateBuilder()
Specifies whether generated model classes should have builder.
|
java.lang.Boolean |
getGenerateClient()
Specifies whether client-side classes should be generated for each query, mutation and subscription.
|
java.lang.String |
getGeneratedAnnotation()
Returns a qualified class name (with package) of the Generated annotation that will be added on top of every
generated class.
|
java.lang.Boolean |
getGenerateDataFetchingEnvironmentArgumentInApis()
If true, then graphql.schema.DataFetchingEnvironment env will be added as a last argument
to all methods of root type resolvers and field resolvers.
|
GeneratedInformation |
getGeneratedInformation() |
GeneratedLanguage |
getGeneratedLanguage()
Generate code with lang
|
java.lang.Boolean |
getGenerateEqualsAndHashCode()
Specifies whether generated model classes should have equals and hashCode methods defined.
|
java.lang.Boolean |
getGenerateExtensionFieldsResolvers()
Whether all fields in extensions (
extend type and extend interface ) should be present
in Resolver interface instead of the type class itself. |
java.lang.Boolean |
getGenerateImmutableModels()
Specifies whether generated model classes should be immutable.
|
java.lang.Boolean |
getGenerateJacksonTypeIdResolver()
Specifies whether generated union interfaces should be annotated with a Jackson type id resolver generated in
model package.
|
java.lang.Boolean |
getGenerateModelsForRootTypes()
Specifies whether model classes should be generated for Query/Subscription/Mutation.
|
java.lang.Boolean |
getGenerateParameterizedFieldsResolvers()
If true, then generate separate `Resolver` interface for parametrized fields.
|
java.lang.Boolean |
getGenerateToString()
Specifies whether generated model classes should have toString method defined.
|
java.util.Set<java.lang.String> |
getInputsName() |
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getInterfaceChildren() |
java.util.Set<java.lang.String> |
getInterfacesName() |
java.lang.String |
getModelNamePrefix()
Sets the prefix for GraphQL model classes (type, input, interface, enum, union).
|
java.lang.String |
getModelNameSuffix()
Sets the suffix for GraphQL model classes (type, input, interface, enum, union).
|
java.lang.String |
getModelPackageName()
Java package for generated model classes (type, input, interface, enum, union).
|
java.lang.String |
getModelValidationAnnotation()
Annotation for mandatory (NonNull) fields.
|
java.lang.String |
getMutationResolverParentInterface()
Interface that will be added as "extend" to all generated api Mutation interfaces.
|
java.util.Set<java.lang.String> |
getOperationsName() |
java.io.File |
getOutputDirectory() |
java.lang.String |
getPackageName()
Java package for generated classes.
|
java.lang.String |
getParametrizedInputSuffix()
The suffix for `ParametrizedInput` classes.
|
java.util.Set<java.lang.String> |
getParametrizedResolverAnnotations()
Annotations that will be added to all parametrized resolver methods.
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getParentInterfaceProperties()
Get a list of fields for each interface
This method is used only for Scala and Kotlin
|
java.lang.String |
getQueryResolverParentInterface()
Interface that will be added as "extend" to all generated api Query interfaces.
|
RelayConfig |
getRelayConfig()
Relay-related configurations.
|
java.lang.String |
getRequestSuffix()
The suffix for `Request` classes.
|
java.util.Set<java.lang.String> |
getResolverArgumentAnnotations()
Annotations that will be added to all resolver arguments.
|
java.lang.String |
getResolverParentInterface()
Interface that will be added as "extend" to all generated TypeResolver interfaces.
|
java.lang.Integer |
getResponseProjectionMaxDepth()
Limit depth when `all$` invoke which has subProjections
|
java.lang.String |
getResponseProjectionSuffix()
The suffix for `ResponseProjection` classes.
|
java.lang.String |
getResponseSuffix()
The suffix for `Response` classes.
|
java.lang.String |
getSubscriptionResolverParentInterface()
Interface that will be added as "extend" to all generated api Subscription interfaces.
|
java.lang.String |
getSubscriptionReturnType()
Return type for subscription methods.
|
java.lang.String |
getTypeResolverPrefix()
Sets the prefix for GraphQL type resolver classes.
|
java.lang.String |
getTypeResolverSuffix()
Sets the suffix for GraphQL type resolver classes.
|
java.util.Set<java.lang.String> |
getTypesAsInterfaces()
Types that must generated as interfaces.
|
java.util.Set<java.lang.String> |
getTypesUnionsInterfacesNames() |
java.util.Set<java.lang.String> |
getUnionsNames() |
java.lang.String |
getUnknownFieldsPropertyName()
Specifies the name of the property to be included in api classes to support unknown
fields during serialization or deserialization
|
java.util.Set<java.lang.String> |
getUseObjectMapperForRequestSerialization()
Fields that require serialization using
ObjectMapper.writeValueAsString(Object) |
java.lang.Boolean |
getUseOptionalForNullableReturnTypes()
Specifies whether return types of generated API interface should be wrapped into
java.util.Optional |
java.lang.Boolean |
isGenerateModelOpenClasses()
Specifies whether generate public model classes.
|
java.lang.Boolean |
isGenerateModelsWithPublicFields()
Specifies whether model classes should have public or private fields.
|
java.lang.Boolean |
isGenerateNoArgsConstructorOnly()
Specifies whether model classes should only have a no-args constructor.
|
java.lang.Boolean |
isGenerateSealedInterfaces()
Specifies whether generate sealed interfaces.
|
java.lang.Boolean |
isInitializeNullableTypes()
Specifies whether classes should be generated with constructors setting the
default value for nullable fields to null.
|
java.lang.Boolean |
isSupportUnknownFields() |
public GeneratedLanguage getGeneratedLanguage()
GraphQLCodegenConfiguration
getGeneratedLanguage
in interface GraphQLCodegenConfiguration
public java.lang.Boolean isGenerateModelOpenClasses()
GraphQLCodegenConfiguration
isGenerateModelOpenClasses
in interface GraphQLCodegenConfiguration
public java.lang.Boolean isInitializeNullableTypes()
GraphQLCodegenConfiguration
isInitializeNullableTypes
in interface GraphQLCodegenConfiguration
public java.lang.Boolean isGenerateSealedInterfaces()
GraphQLCodegenConfiguration
isGenerateSealedInterfaces
in interface GraphQLCodegenConfiguration
public java.util.Map<java.lang.String,java.lang.String> getCustomTypesMapping()
GraphQLCodegenConfiguration
Supports:
E.g.:
DateTime --- String
Price.amount --- java.math.BigDecimal
getCustomTypesMapping
in interface GraphQLCodegenConfiguration
public java.io.File getCustomTemplatesRoot()
GraphQLCodegenConfiguration
getCustomTemplatesRoot
in interface GraphQLCodegenConfiguration
public java.util.Map<java.lang.String,java.lang.String> getCustomTemplates()
GraphQLCodegenConfiguration
getCustomTemplates
in interface GraphQLCodegenConfiguration
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getCustomAnnotationsMapping()
GraphQLCodegenConfiguration
Supports:
E.g.:
EpochMillis --- @com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json
.EpochMillisScalarDeserializer.class)
getCustomAnnotationsMapping
in interface GraphQLCodegenConfiguration
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDirectiveAnnotationsMapping()
GraphQLCodegenConfiguration
Directive fields can be used in annotations via: {{directiveFieldName}}
Example:
schema: directive @auth (roles: [String])
directiveAnnotationsMapping:
auth --- @org.springframework.security.access.annotation.Secured({{roles}})
getDirectiveAnnotationsMapping
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateApis()
GraphQLCodegenConfiguration
getGenerateApis
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateModelsForRootTypes()
GraphQLCodegenConfiguration
getGenerateModelsForRootTypes
in interface GraphQLCodegenConfiguration
public ApiRootInterfaceStrategy getApiRootInterfaceStrategy()
GraphQLCodegenConfiguration
getApiRootInterfaceStrategy
in interface GraphQLCodegenConfiguration
public ApiInterfaceStrategy getApiInterfaceStrategy()
GraphQLCodegenConfiguration
getApiInterfaceStrategy
in interface GraphQLCodegenConfiguration
public java.lang.String getPackageName()
GraphQLCodegenConfiguration
getPackageName
in interface GraphQLCodegenConfiguration
public java.lang.String getApiPackageName()
GraphQLCodegenConfiguration
getApiPackageName
in interface GraphQLCodegenConfiguration
public java.lang.String getModelPackageName()
GraphQLCodegenConfiguration
getModelPackageName
in interface GraphQLCodegenConfiguration
public java.lang.String getModelNamePrefix()
GraphQLCodegenConfiguration
getModelNamePrefix
in interface GraphQLCodegenConfiguration
public java.lang.String getModelNameSuffix()
GraphQLCodegenConfiguration
getModelNameSuffix
in interface GraphQLCodegenConfiguration
public ApiNamePrefixStrategy getApiNamePrefixStrategy()
GraphQLCodegenConfiguration
getApiNamePrefixStrategy
in interface GraphQLCodegenConfiguration
public java.lang.String getApiNamePrefix()
GraphQLCodegenConfiguration
getApiNamePrefix
in interface GraphQLCodegenConfiguration
public java.lang.String getApiNameSuffix()
GraphQLCodegenConfiguration
getApiNameSuffix
in interface GraphQLCodegenConfiguration
public java.lang.String getModelValidationAnnotation()
GraphQLCodegenConfiguration
getModelValidationAnnotation
in interface GraphQLCodegenConfiguration
public java.lang.String getApiReturnType()
GraphQLCodegenConfiguration
getApiReturnType
in interface GraphQLCodegenConfiguration
public java.lang.String getApiReturnListType()
GraphQLCodegenConfiguration
getApiReturnListType
in interface GraphQLCodegenConfiguration
public java.lang.String getSubscriptionReturnType()
GraphQLCodegenConfiguration
getSubscriptionReturnType
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateBuilder()
GraphQLCodegenConfiguration
getGenerateBuilder
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateEqualsAndHashCode()
GraphQLCodegenConfiguration
getGenerateEqualsAndHashCode
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateImmutableModels()
GraphQLCodegenConfiguration
getGenerateImmutableModels
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateToString()
GraphQLCodegenConfiguration
getGenerateToString
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateParameterizedFieldsResolvers()
GraphQLCodegenConfiguration
getGenerateParameterizedFieldsResolvers
in interface GraphQLCodegenConfiguration
public java.lang.String getTypeResolverPrefix()
GraphQLCodegenConfiguration
getTypeResolverPrefix
in interface GraphQLCodegenConfiguration
public java.lang.String getTypeResolverSuffix()
GraphQLCodegenConfiguration
getTypeResolverSuffix
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateExtensionFieldsResolvers()
GraphQLCodegenConfiguration
extend type
and extend interface
) should be present
in Resolver interface instead of the type class itself.getGenerateExtensionFieldsResolvers
in interface GraphQLCodegenConfiguration
extend type
and extend interface
)
should be present in Resolver interface instead of the type class itself.public java.lang.Boolean getGenerateDataFetchingEnvironmentArgumentInApis()
GraphQLCodegenConfiguration
getGenerateDataFetchingEnvironmentArgumentInApis
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateApisWithThrowsException()
GraphQLCodegenConfiguration
throws Exception
.getGenerateApisWithThrowsException
in interface GraphQLCodegenConfiguration
throws Exception
.public java.lang.Boolean getGenerateApisWithSuspendFunctions()
GraphQLCodegenConfiguration
suspend
modifier.getGenerateApisWithSuspendFunctions
in interface GraphQLCodegenConfiguration
suspend
modifier.public java.lang.Boolean getAddGeneratedAnnotation()
GraphQLCodegenConfiguration
getAddGeneratedAnnotation
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateJacksonTypeIdResolver()
GraphQLCodegenConfiguration
getGenerateJacksonTypeIdResolver
in interface GraphQLCodegenConfiguration
public RelayConfig getRelayConfig()
GraphQLCodegenConfiguration
getRelayConfig
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getUseOptionalForNullableReturnTypes()
GraphQLCodegenConfiguration
java.util.Optional
getUseOptionalForNullableReturnTypes
in interface GraphQLCodegenConfiguration
java.util.Optional
public java.util.Set<java.lang.String> getFieldsWithResolvers()
GraphQLCodegenConfiguration
Values should be defined here in format: TypeName, TypeName.fieldName, @directive
If just type is specified, then all fields of this type will have resolvers.
E.g.:
Person
Person.friends
@customResolver
getFieldsWithResolvers
in interface GraphQLCodegenConfiguration
public java.util.Set<java.lang.String> getFieldsWithoutResolvers()
GraphQLCodegenConfiguration
Values should be defined here in format: TypeName, TypeName.fieldName, @directive
If just type is specified, then all fields of this type will NOT have resolvers.
Can be used in conjunction with generateExtensionFieldsResolvers
E.g.:
Person
Person.friends
@customResolver
getFieldsWithoutResolvers
in interface GraphQLCodegenConfiguration
public java.util.Set<java.lang.String> getFieldsToExcludeFromGeneration()
GraphQLCodegenConfiguration
Values should be defined here in format: TypeName.fieldName
E.g.:
Person.friends
getFieldsToExcludeFromGeneration
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateClient()
GraphQLCodegenConfiguration
getGenerateClient
in interface GraphQLCodegenConfiguration
public java.lang.String getRequestSuffix()
GraphQLCodegenConfiguration
getRequestSuffix
in interface GraphQLCodegenConfiguration
public java.lang.String getResponseSuffix()
GraphQLCodegenConfiguration
getResponseSuffix
in interface GraphQLCodegenConfiguration
public java.lang.String getResponseProjectionSuffix()
GraphQLCodegenConfiguration
getResponseProjectionSuffix
in interface GraphQLCodegenConfiguration
public java.lang.String getParametrizedInputSuffix()
GraphQLCodegenConfiguration
getParametrizedInputSuffix
in interface GraphQLCodegenConfiguration
public java.lang.String getQueryResolverParentInterface()
GraphQLCodegenConfiguration
getQueryResolverParentInterface
in interface GraphQLCodegenConfiguration
public java.lang.String getMutationResolverParentInterface()
GraphQLCodegenConfiguration
getMutationResolverParentInterface
in interface GraphQLCodegenConfiguration
public java.lang.String getSubscriptionResolverParentInterface()
GraphQLCodegenConfiguration
getSubscriptionResolverParentInterface
in interface GraphQLCodegenConfiguration
public java.lang.String getResolverParentInterface()
GraphQLCodegenConfiguration
getResolverParentInterface
in interface GraphQLCodegenConfiguration
public java.lang.Boolean getGenerateAllMethodInProjection()
GraphQLCodegenConfiguration
getGenerateAllMethodInProjection
in interface GraphQLCodegenConfiguration
public java.lang.Integer getResponseProjectionMaxDepth()
GraphQLCodegenConfiguration
getResponseProjectionMaxDepth
in interface GraphQLCodegenConfiguration
public java.util.Set<java.lang.String> getUseObjectMapperForRequestSerialization()
GraphQLCodegenConfiguration
ObjectMapper.writeValueAsString(Object)
Values should be defined here in format: GraphqlObjectName.fieldName or GraphqlTypeName
If just type is specified, then all fields of this type will be serialized using ObjectMapper.
E.g.:
Person.createdDateTime
ZonedDateTime
getUseObjectMapperForRequestSerialization
in interface GraphQLCodegenConfiguration
ObjectMapper.writeValueAsString(Object)
public java.util.Set<java.lang.String> getTypesAsInterfaces()
GraphQLCodegenConfiguration
Values should be defined here in format: TypeName, @directive
E.g.:
Person
@asInterface
getTypesAsInterfaces
in interface GraphQLCodegenConfiguration
public java.util.Set<java.lang.String> getResolverArgumentAnnotations()
GraphQLCodegenConfiguration
E.g.:
@org.springframework.graphql.data.method.annotation.Argument
getResolverArgumentAnnotations
in interface GraphQLCodegenConfiguration
public java.util.Set<java.lang.String> getParametrizedResolverAnnotations()
GraphQLCodegenConfiguration
E.g.:
@org.springframework.graphql.data.method.annotation.Argument
getParametrizedResolverAnnotations
in interface GraphQLCodegenConfiguration
public java.lang.Boolean isSupportUnknownFields()
isSupportUnknownFields
in interface GraphQLCodegenConfiguration
public java.lang.String getUnknownFieldsPropertyName()
GraphQLCodegenConfiguration
getUnknownFieldsPropertyName
in interface GraphQLCodegenConfiguration
public java.lang.String getGeneratedAnnotation()
GraphQLCodegenConfiguration
getGeneratedAnnotation
in interface GraphQLCodegenConfiguration
public java.lang.Boolean isGenerateNoArgsConstructorOnly()
GraphQLCodegenConfiguration
isGenerateNoArgsConstructorOnly
in interface GraphQLCodegenConfiguration
public java.lang.Boolean isGenerateModelsWithPublicFields()
GraphQLCodegenConfiguration
isGenerateModelsWithPublicFields
in interface GraphQLCodegenConfiguration
public ExtendedDocument getDocument()
public java.util.Set<java.lang.String> getTypesUnionsInterfacesNames()
public java.util.Set<java.lang.String> getInterfacesName()
public java.util.Set<java.lang.String> getUnionsNames()
public java.util.Set<java.lang.String> getOperationsName()
public java.util.Set<java.lang.String> getInputsName()
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getInterfaceChildren()
public GeneratedInformation getGeneratedInformation()
public java.io.File getOutputDirectory()
public java.util.Set<java.lang.String> getEnumImportItSelfInScala()
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getParentInterfaceProperties()
public java.util.Set<java.lang.String> getFieldNamesWithResolvers()
public static MappingContext.Builder builder()