public class MappingContext extends java.lang.Object implements GraphQLCodegenConfiguration
| 构造器和说明 |
|---|
MappingContext(MappingConfig mappingConfig,
ExtendedDocument document,
GeneratedInformation generatedInformation) |
| 限定符和类型 | 方法和说明 |
|---|---|
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> |
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> |
getFieldsWithoutResolvers()
Fields that DO NOT require Resolvers 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.friends"
E.g.: "Person"
E.g.: "@noResolver"
|
java.util.Set<java.lang.String> |
getFieldsWithResolvers()
Fields that require Resolvers 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.friends"
E.g.: "Person"
E.g.: "@customResolver"
|
java.lang.Boolean |
getGenerateApis()
Specifies whether api classes should be generated.
|
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 |
getGenerateDefaultResolverImpl()
Default impl will be generate for resolvers
|
GeneratedInformation |
getGeneratedInformation() |
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.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.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.
|
RelayConfig |
getRelayConfig()
Relay-related configurations.
|
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.Integer |
getResponseProjectionMaxDepth()
Interface that will be 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> |
getTypesUnionsInterfacesNames() |
java.lang.Boolean |
getUseOptionalForNullableReturnTypes()
Specifies whether return types of generated API interface should be wrapped into
java.util.Optional |
public MappingContext(MappingConfig mappingConfig, ExtendedDocument document, GeneratedInformation generatedInformation)
public java.lang.Integer getResponseProjectionMaxDepth()
GraphQLCodegenConfigurationgetResponseProjectionMaxDepth 在接口中 GraphQLCodegenConfigurationpublic java.util.Map<java.lang.String,java.lang.String> getCustomTypesMapping()
GraphQLCodegenConfigurationSupports: * Map of (GraphqlObjectName.fieldName) to (JavaType) * Map of (GraphqlType) to (JavaType)
e.g.: DateTime --- String e.g.: Price.amount --- java.math.BigDecimal
getCustomTypesMapping 在接口中 GraphQLCodegenConfigurationpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getCustomAnnotationsMapping()
GraphQLCodegenConfigurationSupports: * 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 在接口中 GraphQLCodegenConfigurationpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDirectiveAnnotationsMapping()
GraphQLCodegenConfigurationDirective fields can be used in annotations via: {{directiveFieldName}}
Example:
schema: directive @auth (roles: [String])
directiveAnnotationsMapping: auth --- @org.springframework.security.access.annotation.Secured({{roles}})
getDirectiveAnnotationsMapping 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateApis()
GraphQLCodegenConfigurationgetGenerateApis 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateModelsForRootTypes()
GraphQLCodegenConfigurationgetGenerateModelsForRootTypes 在接口中 GraphQLCodegenConfigurationpublic ApiRootInterfaceStrategy getApiRootInterfaceStrategy()
GraphQLCodegenConfigurationgetApiRootInterfaceStrategy 在接口中 GraphQLCodegenConfigurationpublic ApiInterfaceStrategy getApiInterfaceStrategy()
GraphQLCodegenConfigurationgetApiInterfaceStrategy 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getPackageName()
GraphQLCodegenConfigurationgetPackageName 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getApiPackageName()
GraphQLCodegenConfigurationgetApiPackageName 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getModelPackageName()
GraphQLCodegenConfigurationgetModelPackageName 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getModelNamePrefix()
GraphQLCodegenConfigurationgetModelNamePrefix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getModelNameSuffix()
GraphQLCodegenConfigurationgetModelNameSuffix 在接口中 GraphQLCodegenConfigurationpublic ApiNamePrefixStrategy getApiNamePrefixStrategy()
GraphQLCodegenConfigurationgetApiNamePrefixStrategy 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getApiNamePrefix()
GraphQLCodegenConfigurationgetApiNamePrefix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getApiNameSuffix()
GraphQLCodegenConfigurationgetApiNameSuffix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getModelValidationAnnotation()
GraphQLCodegenConfigurationgetModelValidationAnnotation 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getApiReturnType()
GraphQLCodegenConfigurationgetApiReturnType 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getApiReturnListType()
GraphQLCodegenConfigurationgetApiReturnListType 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getSubscriptionReturnType()
GraphQLCodegenConfigurationgetSubscriptionReturnType 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateBuilder()
GraphQLCodegenConfigurationgetGenerateBuilder 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateEqualsAndHashCode()
GraphQLCodegenConfigurationgetGenerateEqualsAndHashCode 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateImmutableModels()
GraphQLCodegenConfigurationgetGenerateImmutableModels 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateToString()
GraphQLCodegenConfigurationgetGenerateToString 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateParameterizedFieldsResolvers()
GraphQLCodegenConfigurationgetGenerateParameterizedFieldsResolvers 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getTypeResolverPrefix()
GraphQLCodegenConfigurationgetTypeResolverPrefix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getTypeResolverSuffix()
GraphQLCodegenConfigurationgetTypeResolverSuffix 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateExtensionFieldsResolvers()
GraphQLCodegenConfigurationextend type and extend interface) should be present
in Resolver interface instead of the type class itself.getGenerateExtensionFieldsResolvers 在接口中 GraphQLCodegenConfigurationextend type and extend interface)
should be present in Resolver interface instead of the type class itself.public java.lang.Boolean getGenerateDataFetchingEnvironmentArgumentInApis()
GraphQLCodegenConfigurationgetGenerateDataFetchingEnvironmentArgumentInApis 在接口中 GraphQLCodegenConfigurationpublic RelayConfig getRelayConfig()
GraphQLCodegenConfigurationgetRelayConfig 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getUseOptionalForNullableReturnTypes()
GraphQLCodegenConfigurationjava.util.OptionalgetUseOptionalForNullableReturnTypes 在接口中 GraphQLCodegenConfigurationjava.util.Optionalpublic java.util.Set<java.lang.String> getFieldsWithResolvers()
GraphQLCodegenConfigurationE.g.: "Person.friends" E.g.: "Person" E.g.: "@customResolver"
getFieldsWithResolvers 在接口中 GraphQLCodegenConfigurationpublic java.util.Set<java.lang.String> getFieldsWithoutResolvers()
GraphQLCodegenConfigurationE.g.: "Person.friends" E.g.: "Person" E.g.: "@noResolver"
getFieldsWithoutResolvers 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateClient()
GraphQLCodegenConfigurationgetGenerateClient 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getRequestSuffix()
GraphQLCodegenConfigurationgetRequestSuffix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getResponseSuffix()
GraphQLCodegenConfigurationgetResponseSuffix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getResponseProjectionSuffix()
GraphQLCodegenConfigurationgetResponseProjectionSuffix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getParametrizedInputSuffix()
GraphQLCodegenConfigurationgetParametrizedInputSuffix 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getQueryResolverParentInterface()
GraphQLCodegenConfigurationgetQueryResolverParentInterface 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getMutationResolverParentInterface()
GraphQLCodegenConfigurationgetMutationResolverParentInterface 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getSubscriptionResolverParentInterface()
GraphQLCodegenConfigurationgetSubscriptionResolverParentInterface 在接口中 GraphQLCodegenConfigurationpublic java.lang.String getResolverParentInterface()
GraphQLCodegenConfigurationgetResolverParentInterface 在接口中 GraphQLCodegenConfigurationpublic java.lang.Boolean getGenerateDefaultResolverImpl()
GraphQLCodegenConfigurationgetGenerateDefaultResolverImpl 在接口中 GraphQLCodegenConfigurationpublic ExtendedDocument getDocument()
public java.util.Set<java.lang.String> getTypesUnionsInterfacesNames()
public java.util.Set<java.lang.String> getInterfacesName()
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getInterfaceChildren()
public GeneratedInformation getGeneratedInformation()