public class MappingConfig extends java.lang.Object implements GraphQLCodegenConfiguration, Combinable<MappingConfig>
Constructor and Description |
---|
MappingConfig() |
Modifier and Type | Method and Description |
---|---|
void |
combine(MappingConfig source)
Combine with source.
|
java.lang.String |
getApiAsyncReturnListType()
Async return type for api methods (query / subscription) that return list values
For example: `reactor.core.publisher.Flux`
|
java.lang.String |
getApiAsyncReturnType()
Async return type for api methods (query / subscription)
For example: `reactor.core.publisher.Mono`
|
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).
|
ApiRootInterfaceStrategy |
getApiRootInterfaceStrategy()
Specifies the strategy of generating root api interface.
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomAnnotationsMapping()
Can be used to supply custom annotations (serializers) for scalars.
|
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.lang.String> |
getDirectiveAnnotationsMapping()
Map GraphQL directives to Java annotations.
|
java.util.Set<java.lang.String> |
getFieldsWithoutResolvers()
Fields that DO NOT require Resolvers should be defined here in format: TypeName.fieldName
If just type is specified, then all fields of this type will NOT have resolvers
Can be used in conjunction with "generateExtensionFieldsResolvers"
|
java.util.Set<java.lang.String> |
getFieldsWithResolvers()
Fields that require Resolvers should be defined here in format: TypeName.fieldName
If just type is specified, then all fields of this type will have resolvers
|
java.lang.Boolean |
getGenerateApis()
Specifies whether api classes should be generated.
|
java.lang.Boolean |
getGenerateAsyncApi()
If true, then wrap type into `java.util.concurrent.CompletableFuture` or `subscriptionReturnType`
|
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.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.
|
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 |
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.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.lang.String |
getPackageName()
Java package for generated classes.
|
java.lang.String |
getParametrizedInputSuffix()
The suffix for `ParametrizedInput` classes.
|
java.lang.String |
getQueryResolverParentInterface()
Interface that will be added as "extend" to all generated api Query interfaces.
|
java.lang.String |
getRequestSuffix()
The suffix for `Request` classes.
|
java.lang.String |
getResolverParentInterface()
Interface that will be added as "extend" to all generated TypeResolver interfaces.
|
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()
Async 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.
|
void |
putCustomTypeMappingIfAbsent(java.lang.String from,
java.lang.String to)
Put custom type mapping if absent.
|
void |
setApiAsyncReturnListType(java.lang.String apiAsyncReturnListType) |
void |
setApiAsyncReturnType(java.lang.String apiAsyncReturnType) |
void |
setApiNamePrefix(java.lang.String apiNamePrefix) |
void |
setApiNamePrefixStrategy(ApiNamePrefixStrategy apiNamePrefixStrategy) |
void |
setApiNameSuffix(java.lang.String apiNameSuffix) |
void |
setApiPackageName(java.lang.String apiPackageName) |
void |
setApiRootInterfaceStrategy(ApiRootInterfaceStrategy apiRootInterfaceStrategy) |
void |
setCustomAnnotationsMapping(java.util.Map<java.lang.String,java.lang.String> customAnnotationsMapping) |
void |
setCustomTypesMapping(java.util.Map<java.lang.String,java.lang.String> customTypesMapping) |
void |
setDirectiveAnnotationsMapping(java.util.Map<java.lang.String,java.lang.String> directiveAnnotationsMapping) |
void |
setFieldsWithoutResolvers(java.util.Set<java.lang.String> fieldsWithoutResolvers) |
void |
setFieldsWithResolvers(java.util.Set<java.lang.String> fieldsWithResolvers) |
void |
setGenerateApis(java.lang.Boolean generateApis) |
void |
setGenerateAsyncApi(java.lang.Boolean generateAsyncApi) |
void |
setGenerateBuilder(java.lang.Boolean generateBuilder) |
void |
setGenerateClient(java.lang.Boolean generateClient) |
void |
setGenerateDataFetchingEnvironmentArgumentInApis(java.lang.Boolean generateDataFetchingEnvironmentArgumentInApis) |
void |
setGenerateEqualsAndHashCode(java.lang.Boolean generateEqualsAndHashCode) |
void |
setGenerateExtensionFieldsResolvers(java.lang.Boolean generateExtensionFieldsResolvers) |
void |
setGenerateImmutableModels(java.lang.Boolean generateImmutableModels) |
void |
setGenerateModelsForRootTypes(java.lang.Boolean generateModelsForRootTypes) |
void |
setGenerateParameterizedFieldsResolvers(java.lang.Boolean generateParameterizedFieldsResolvers) |
void |
setGenerateToString(java.lang.Boolean generateToString) |
void |
setModelNamePrefix(java.lang.String modelNamePrefix) |
void |
setModelNameSuffix(java.lang.String modelNameSuffix) |
void |
setModelPackageName(java.lang.String modelPackageName) |
void |
setModelValidationAnnotation(java.lang.String modelValidationAnnotation) |
void |
setMutationResolverParentInterface(java.lang.String mutationResolverParentInterface) |
void |
setPackageName(java.lang.String packageName) |
void |
setParametrizedInputSuffix(java.lang.String parametrizedInputSuffix) |
void |
setQueryResolverParentInterface(java.lang.String queryResolverParentInterface) |
void |
setRequestSuffix(java.lang.String requestSuffix) |
void |
setResolverParentInterface(java.lang.String resolverParentInterface) |
void |
setResponseProjectionSuffix(java.lang.String responseProjectionSuffix) |
void |
setResponseSuffix(java.lang.String responseSuffix) |
void |
setSubscriptionResolverParentInterface(java.lang.String subscriptionResolverParentInterface) |
void |
setSubscriptionReturnType(java.lang.String subscriptionReturnType) |
void |
setTypeResolverPrefix(java.lang.String typeResolverPrefix) |
void |
setTypeResolverSuffix(java.lang.String typeResolverSuffix) |
public void combine(MappingConfig source)
Combinable
combine
in interface Combinable<MappingConfig>
source
- the sourcepublic void putCustomTypeMappingIfAbsent(java.lang.String from, java.lang.String to)
from
- the fromto
- the topublic java.util.Map<java.lang.String,java.lang.String> getCustomTypesMapping()
GraphQLCodegenConfiguration
Supports: * Map of (GraphqlObjectName.fieldName) to (JavaType) * Map of (GraphqlType) to (JavaType)
e.g.: DateTime --- String e.g.: Price.amount --- java.math.BigDecimal
getCustomTypesMapping
in interface GraphQLCodegenConfiguration
public void setCustomTypesMapping(java.util.Map<java.lang.String,java.lang.String> customTypesMapping)
public java.util.Map<java.lang.String,java.lang.String> getCustomAnnotationsMapping()
GraphQLCodegenConfiguration
Supports: * Map of (GraphqlObjectName.fieldName) to (JavaAnnotation) * Map of (GraphqlType) to (JavaAnnotation)
e.g.: EpochMillis --- @com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.EpochMillisScalarDeserializer.class)
getCustomAnnotationsMapping
in interface GraphQLCodegenConfiguration
public void setCustomAnnotationsMapping(java.util.Map<java.lang.String,java.lang.String> customAnnotationsMapping)
public java.util.Map<java.lang.String,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 void setDirectiveAnnotationsMapping(java.util.Map<java.lang.String,java.lang.String> directiveAnnotationsMapping)
public java.lang.String getPackageName()
GraphQLCodegenConfiguration
getPackageName
in interface GraphQLCodegenConfiguration
public void setPackageName(java.lang.String packageName)
public java.lang.String getApiPackageName()
GraphQLCodegenConfiguration
getApiPackageName
in interface GraphQLCodegenConfiguration
public void setApiPackageName(java.lang.String apiPackageName)
public java.lang.String getModelPackageName()
GraphQLCodegenConfiguration
getModelPackageName
in interface GraphQLCodegenConfiguration
public void setModelPackageName(java.lang.String modelPackageName)
public java.lang.String getModelNamePrefix()
GraphQLCodegenConfiguration
getModelNamePrefix
in interface GraphQLCodegenConfiguration
public void setModelNamePrefix(java.lang.String modelNamePrefix)
public java.lang.String getModelNameSuffix()
GraphQLCodegenConfiguration
getModelNameSuffix
in interface GraphQLCodegenConfiguration
public void setModelNameSuffix(java.lang.String modelNameSuffix)
public java.lang.String getApiNamePrefix()
GraphQLCodegenConfiguration
getApiNamePrefix
in interface GraphQLCodegenConfiguration
public void setApiNamePrefix(java.lang.String apiNamePrefix)
public java.lang.String getApiNameSuffix()
GraphQLCodegenConfiguration
getApiNameSuffix
in interface GraphQLCodegenConfiguration
public void setApiNameSuffix(java.lang.String apiNameSuffix)
public java.lang.String getTypeResolverPrefix()
GraphQLCodegenConfiguration
getTypeResolverPrefix
in interface GraphQLCodegenConfiguration
public void setTypeResolverPrefix(java.lang.String typeResolverPrefix)
public java.lang.String getTypeResolverSuffix()
GraphQLCodegenConfiguration
getTypeResolverSuffix
in interface GraphQLCodegenConfiguration
public void setTypeResolverSuffix(java.lang.String typeResolverSuffix)
public ApiRootInterfaceStrategy getApiRootInterfaceStrategy()
GraphQLCodegenConfiguration
getApiRootInterfaceStrategy
in interface GraphQLCodegenConfiguration
public void setApiRootInterfaceStrategy(ApiRootInterfaceStrategy apiRootInterfaceStrategy)
public ApiNamePrefixStrategy getApiNamePrefixStrategy()
GraphQLCodegenConfiguration
getApiNamePrefixStrategy
in interface GraphQLCodegenConfiguration
public void setApiNamePrefixStrategy(ApiNamePrefixStrategy apiNamePrefixStrategy)
public java.lang.String getModelValidationAnnotation()
GraphQLCodegenConfiguration
getModelValidationAnnotation
in interface GraphQLCodegenConfiguration
public void setModelValidationAnnotation(java.lang.String modelValidationAnnotation)
public java.lang.String getApiAsyncReturnType()
GraphQLCodegenConfiguration
getApiAsyncReturnType
in interface GraphQLCodegenConfiguration
public void setApiAsyncReturnType(java.lang.String apiAsyncReturnType)
public java.lang.String getApiAsyncReturnListType()
GraphQLCodegenConfiguration
getApiAsyncReturnListType
in interface GraphQLCodegenConfiguration
public void setApiAsyncReturnListType(java.lang.String apiAsyncReturnListType)
public java.lang.String getSubscriptionReturnType()
GraphQLCodegenConfiguration
getSubscriptionReturnType
in interface GraphQLCodegenConfiguration
public void setSubscriptionReturnType(java.lang.String subscriptionReturnType)
public java.lang.Boolean getGenerateApis()
GraphQLCodegenConfiguration
getGenerateApis
in interface GraphQLCodegenConfiguration
public void setGenerateApis(java.lang.Boolean generateApis)
public java.lang.Boolean getGenerateBuilder()
GraphQLCodegenConfiguration
getGenerateBuilder
in interface GraphQLCodegenConfiguration
public void setGenerateBuilder(java.lang.Boolean generateBuilder)
public java.lang.Boolean getGenerateEqualsAndHashCode()
GraphQLCodegenConfiguration
getGenerateEqualsAndHashCode
in interface GraphQLCodegenConfiguration
public void setGenerateEqualsAndHashCode(java.lang.Boolean generateEqualsAndHashCode)
public java.lang.Boolean getGenerateToString()
GraphQLCodegenConfiguration
getGenerateToString
in interface GraphQLCodegenConfiguration
public void setGenerateToString(java.lang.Boolean generateToString)
public java.lang.Boolean getGenerateImmutableModels()
GraphQLCodegenConfiguration
getGenerateImmutableModels
in interface GraphQLCodegenConfiguration
public void setGenerateImmutableModels(java.lang.Boolean generateImmutableModels)
public java.lang.Boolean getGenerateAsyncApi()
GraphQLCodegenConfiguration
getGenerateAsyncApi
in interface GraphQLCodegenConfiguration
public void setGenerateAsyncApi(java.lang.Boolean generateAsyncApi)
public java.lang.Boolean getGenerateParameterizedFieldsResolvers()
GraphQLCodegenConfiguration
getGenerateParameterizedFieldsResolvers
in interface GraphQLCodegenConfiguration
public void setGenerateParameterizedFieldsResolvers(java.lang.Boolean generateParameterizedFieldsResolvers)
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 void setGenerateExtensionFieldsResolvers(java.lang.Boolean generateExtensionFieldsResolvers)
public java.lang.Boolean getGenerateDataFetchingEnvironmentArgumentInApis()
GraphQLCodegenConfiguration
getGenerateDataFetchingEnvironmentArgumentInApis
in interface GraphQLCodegenConfiguration
public void setGenerateDataFetchingEnvironmentArgumentInApis(java.lang.Boolean generateDataFetchingEnvironmentArgumentInApis)
public java.lang.Boolean getGenerateModelsForRootTypes()
GraphQLCodegenConfiguration
getGenerateModelsForRootTypes
in interface GraphQLCodegenConfiguration
public void setGenerateModelsForRootTypes(java.lang.Boolean generateModelsForRootTypes)
public java.util.Set<java.lang.String> getFieldsWithResolvers()
GraphQLCodegenConfiguration
E.g.: "Person.friends" E.g.: "Person"
getFieldsWithResolvers
in interface GraphQLCodegenConfiguration
public void setFieldsWithResolvers(java.util.Set<java.lang.String> fieldsWithResolvers)
public java.util.Set<java.lang.String> getFieldsWithoutResolvers()
GraphQLCodegenConfiguration
E.g.: "Person.friends" E.g.: "Person"
getFieldsWithoutResolvers
in interface GraphQLCodegenConfiguration
public void setFieldsWithoutResolvers(java.util.Set<java.lang.String> fieldsWithoutResolvers)
public java.lang.String getQueryResolverParentInterface()
GraphQLCodegenConfiguration
getQueryResolverParentInterface
in interface GraphQLCodegenConfiguration
public void setQueryResolverParentInterface(java.lang.String queryResolverParentInterface)
public java.lang.String getMutationResolverParentInterface()
GraphQLCodegenConfiguration
getMutationResolverParentInterface
in interface GraphQLCodegenConfiguration
public void setMutationResolverParentInterface(java.lang.String mutationResolverParentInterface)
public java.lang.String getSubscriptionResolverParentInterface()
GraphQLCodegenConfiguration
getSubscriptionResolverParentInterface
in interface GraphQLCodegenConfiguration
public void setSubscriptionResolverParentInterface(java.lang.String subscriptionResolverParentInterface)
public java.lang.String getResolverParentInterface()
GraphQLCodegenConfiguration
getResolverParentInterface
in interface GraphQLCodegenConfiguration
public void setResolverParentInterface(java.lang.String resolverParentInterface)
public java.lang.Boolean getGenerateClient()
GraphQLCodegenConfiguration
getGenerateClient
in interface GraphQLCodegenConfiguration
public void setGenerateClient(java.lang.Boolean generateClient)
public java.lang.String getRequestSuffix()
GraphQLCodegenConfiguration
getRequestSuffix
in interface GraphQLCodegenConfiguration
public void setRequestSuffix(java.lang.String requestSuffix)
public java.lang.String getResponseSuffix()
GraphQLCodegenConfiguration
getResponseSuffix
in interface GraphQLCodegenConfiguration
public void setResponseSuffix(java.lang.String responseSuffix)
public java.lang.String getResponseProjectionSuffix()
GraphQLCodegenConfiguration
getResponseProjectionSuffix
in interface GraphQLCodegenConfiguration
public void setResponseProjectionSuffix(java.lang.String responseProjectionSuffix)
public java.lang.String getParametrizedInputSuffix()
GraphQLCodegenConfiguration
getParametrizedInputSuffix
in interface GraphQLCodegenConfiguration
public void setParametrizedInputSuffix(java.lang.String parametrizedInputSuffix)