未验证 提交 94a83577 编写于 作者: R Robbert Noordzij 提交者: GitHub

Ability to disable generation of the all$ method in projections (#645)

* Add flag for generating the all method in projections

* Add generation of all methods to plugin

* Add to documentation

* Move pojectionDepthOnFields to concrete implementation of projection
Co-authored-by: NRobbert Noordzij <robbert.noordzij@ns.nl>
上级 cd49eaef
......@@ -51,6 +51,7 @@ See [DirectiveAnnotationsMapping](#option-directiveannotationsmapping)* |
| `responseProjectionSuffix` | String | ResponseProjection | Sets the suffix for `ResponseProjection` classes. |
| `parametrizedInputSuffix` | String | ParametrizedInput | Sets the suffix for `ParametrizedInput` classes. |
| `parentInterfaces` | *See<br>[parentInterfaces](#option-parentinterfaces)* | Empty | Block to define parent interfaces for generated interfaces (query / mutation / subscription / type resolver). *See [parentInterfaces](#option-parentinterfaces)* |
| `generateAllMethodInProjection` | Boolean | true | Enables whether the `all$()` method should be generated in the projection classes. Disabling enforces the client to select the fields manually. |
| `responseProjectionMaxDepth` | Integer | 3 | Sets max depth when use `all$()` which for facilitating the construction of projection automatically, the fields on all projections are provided when it be invoked. This is a global configuration, of course, you can use `all$(max)` to set for each method. For self recursive types, too big depth may result in a large number of returned data!|
| `generatedLanguage` | Enum | GeneratedLanguage.JAVA | Choose which language you want to generate, Java,Scala,Kotlin were supported. Note that due to language features, there are slight differences in default values between languages.|
| `generateModelOpenClasses` | Boolean | false | The class type of the generated model. If true, generate normal classes, else generate data classes. It only support in kotlin(```data class```) and scala(```case class```). Maybe we will consider to support Java ```record``` in the future.|
......
......@@ -94,6 +94,7 @@ public class GraphQLCodegenGradleTask extends DefaultTask implements GraphQLCode
private String responseSuffix;
private String responseProjectionSuffix;
private String parametrizedInputSuffix;
private Boolean generateAllMethodInProjection = MappingConfigConstants.DEFAULT_GENERATE_ALL_METHOD;
private int responseProjectionMaxDepth = MappingConfigConstants.DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH;
private Set<String> useObjectMapperForRequestSerialization = new HashSet<>();
......@@ -165,6 +166,7 @@ public class GraphQLCodegenGradleTask extends DefaultTask implements GraphQLCode
mappingConfig.setParametrizedInputSuffix(parametrizedInputSuffix);
mappingConfig.setUseObjectMapperForRequestSerialization(useObjectMapperForRequestSerialization != null ?
useObjectMapperForRequestSerialization : new HashSet<>());
mappingConfig.setGenerateAllMethodInProjection(generateAllMethodInProjection);
mappingConfig.setResponseProjectionMaxDepth(responseProjectionMaxDepth);
mappingConfig.setResolverParentInterface(getResolverParentInterface());
......@@ -742,6 +744,17 @@ public class GraphQLCodegenGradleTask extends DefaultTask implements GraphQLCode
this.useObjectMapperForRequestSerialization = useObjectMapperForRequestSerialization;
}
@Input
@Optional
@Override
public Boolean getGenerateAllMethodInProjection() {
return generateAllMethodInProjection;
}
public void setGenerateAllMethodInProjection(boolean generateAllMethodInProjection) {
this.generateAllMethodInProjection = generateAllMethodInProjection;
}
@Input
@Optional
@Override
......
......@@ -185,6 +185,9 @@ public class GraphQLCodegenMojo extends AbstractMojo implements GraphQLCodegenCo
@Parameter(defaultValue = MappingConfigConstants.DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH_STRING)
private int responseProjectionMaxDepth;
@Parameter(defaultValue = MappingConfigConstants.DEFAULT_GENERATE_ALL_METHOD_STRING)
private boolean generateAllMethodInProjection;
@Parameter
private ParentInterfacesConfig parentInterfaces = new ParentInterfacesConfig();
......@@ -248,6 +251,7 @@ public class GraphQLCodegenMojo extends AbstractMojo implements GraphQLCodegenCo
mappingConfig.setResponseSuffix(responseSuffix);
mappingConfig.setResponseProjectionSuffix(responseProjectionSuffix);
mappingConfig.setParametrizedInputSuffix(parametrizedInputSuffix);
mappingConfig.setGenerateAllMethodInProjection(generateAllMethodInProjection);
mappingConfig.setResponseProjectionMaxDepth(responseProjectionMaxDepth);
mappingConfig.setUseObjectMapperForRequestSerialization(mapToHashSet(useObjectMapperForRequestSerialization));
mappingConfig.setTypesAsInterfaces(mapToHashSet(typesAsInterfaces));
......@@ -515,6 +519,11 @@ public class GraphQLCodegenMojo extends AbstractMojo implements GraphQLCodegenCo
return mapToHashSet(fieldsWithoutResolvers);
}
@Override
public Boolean getGenerateAllMethodInProjection() {
return generateAllMethodInProjection;
}
@Override
public Integer getResponseProjectionMaxDepth() {
return responseProjectionMaxDepth;
......
......@@ -114,6 +114,8 @@ trait GraphQLCodegenKeys {
val graphqlQueryIntrospectionResultPath = settingKey[Option[String]]("graphqlQueryIntrospectionResultPath")
val generateAllMethodInProjection = settingKey[Boolean]("generateAllMethodInProjection")
val responseProjectionMaxDepth = settingKey[Int]("limit depth when the projection is constructed automatically")
val relayConfig = settingKey[RelayConfig]("Can be used to supply a custom configuration for Relay support.")
......
......@@ -114,6 +114,7 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
generateToString := MappingConfigConstants.DEFAULT_TO_STRING,
// parent interfaces configs:
parentInterfaces := parentInterfacesConfig,
generateAllMethodInProjection := MappingConfigConstants.DEFAULT_GENERATE_ALL_METHOD,
responseProjectionMaxDepth := MappingConfigConstants.DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH
)
......@@ -163,6 +164,7 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
mappingConfig.setUseOptionalForNullableReturnTypes((useOptionalForNullableReturnTypes in GraphQLCodegenConfig).value)
mappingConfig.setGenerateApisWithThrowsException((generateApisWithThrowsException in GraphQLCodegenConfig).value)
mappingConfig.setAddGeneratedAnnotation((addGeneratedAnnotation in GraphQLCodegenConfig).value)
mappingConfig.setGenerateAllMethodInProjection((generateAllMethodInProjection in GraphQLCodegenConfig).value)
mappingConfig.setResponseProjectionMaxDepth((responseProjectionMaxDepth in GraphQLCodegenConfig).value)
mappingConfig.setRelayConfig((relayConfig in GraphQLCodegenConfig).value)
mappingConfig.setGeneratedLanguage((generatedLanguage in GraphQLCodegenConfig).value)
......
......@@ -2,6 +2,8 @@ package com.kobylynskyi.graphql.codegen;
import com.kobylynskyi.graphql.codegen.model.GeneratedLanguage;
import com.kobylynskyi.graphql.codegen.model.exception.UnableToLoadFreeMarkerTemplateException;
import freemarker.core.OutputFormat;
import freemarker.core.PlainTextOutputFormat;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.Configuration;
import freemarker.template.Template;
......@@ -33,6 +35,7 @@ class FreeMarkerTemplatesRegistry {
Configuration configuration = new Configuration(FREEMARKER_TEMPLATE_VERSION);
configuration.setClassLoaderForTemplateLoading(GraphQLCodegen.class.getClassLoader(), "");
configuration.setDefaultEncoding("UTF-8");
configuration.setOutputFormat(PlainTextOutputFormat.INSTANCE);
configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
configuration.setLogTemplateExceptions(false);
configuration.setWrapUncheckedExceptions(true);
......
......@@ -208,6 +208,9 @@ public abstract class GraphQLCodegen {
if (mappingConfig.getGeneratedLanguage() == null) {
mappingConfig.setGeneratedLanguage(MappingConfigConstants.DEFAULT_GENERATED_LANGUAGE);
}
if (mappingConfig.getGenerateAllMethodInProjection() == null) {
mappingConfig.setGenerateAllMethodInProjection(MappingConfigConstants.DEFAULT_GENERATE_ALL_METHOD);
}
}
private void validateConfigs(MappingConfig mappingConfig) {
......
......@@ -27,6 +27,7 @@ import static com.kobylynskyi.graphql.codegen.model.DataModelFields.EQUALS_AND_H
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.FIELDS;
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.GENERATED_ANNOTATION;
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.GENERATED_INFO;
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.GENERATE_ALL_METHOD_IN_PROJECTION;
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.JAVA_DOC;
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.METHOD_NAME;
import static com.kobylynskyi.graphql.codegen.model.DataModelFields.OPERATION_NAME;
......@@ -118,6 +119,7 @@ public class RequestResponseDefinitionToDataModelMapper {
dataModel.put(EQUALS_AND_HASH_CODE, mappingContext.getGenerateEqualsAndHashCode());
dataModel.put(GENERATED_ANNOTATION, mappingContext.getAddGeneratedAnnotation());
dataModel.put(GENERATED_INFO, mappingContext.getGeneratedInformation());
dataModel.put(GENERATE_ALL_METHOD_IN_PROJECTION, mappingContext.getGenerateAllMethodInProjection());
dataModel.put(RESPONSE_PROJECTION_MAX_DEPTH, mappingContext.getResponseProjectionMaxDepth());
// dataModel.put(TO_STRING, mappingConfig.getGenerateToString()); always generated for serialization purposes
return dataModel;
......
......@@ -28,6 +28,7 @@ public final class DataModelFields {
public static final String RETURN_TYPE_NAME = "returnTypeName";
public static final String GENERATED_ANNOTATION = "generatedAnnotation";
public static final String GENERATED_INFO = "generatedInfo";
public static final String GENERATE_ALL_METHOD_IN_PROJECTION = "generateAllMethodInProjection";
public static final String RESPONSE_PROJECTION_MAX_DEPTH = "responseProjectionMaxDepth";
public static final String ENUM_IMPORT_IT_SELF_IN_SCALA = "enumImportItSelfInScala";
public static final String PARENT_INTERFACE_PROPERTIES = "parentInterfaceProperties";
......
......@@ -375,6 +375,13 @@ public interface GraphQLCodegenConfiguration {
*/
String getResolverParentInterface();
/**
* Enables the generation of the all$ method in the projection classes of the client.
*
* @return whether the generation is enabled.
*/
Boolean getGenerateAllMethodInProjection();
/**
* Limit depth when `all$` invoke which has subProjections
*
......
......@@ -70,6 +70,7 @@ public class MappingConfig implements GraphQLCodegenConfiguration, Combinable<Ma
private String responseSuffix;
private String responseProjectionSuffix;
private String parametrizedInputSuffix;
private Boolean generateAllMethodInProjection;
private Integer responseProjectionMaxDepth;
private Set<String> useObjectMapperForRequestSerialization = new HashSet<>();
......@@ -171,6 +172,8 @@ public class MappingConfig implements GraphQLCodegenConfiguration, Combinable<Ma
customTypesMapping = combineMap(customTypesMapping, source.customTypesMapping);
customAnnotationsMapping = combineMap(customAnnotationsMapping, source.customAnnotationsMapping);
directiveAnnotationsMapping = combineMap(directiveAnnotationsMapping, source.directiveAnnotationsMapping);
generateAllMethodInProjection = getValueOrDefaultToThis(source,
GraphQLCodegenConfiguration::getGenerateAllMethodInProjection);
responseProjectionMaxDepth = getValueOrDefaultToThis(source,
GraphQLCodegenConfiguration::getResponseProjectionMaxDepth);
useObjectMapperForRequestSerialization = combineSet(useObjectMapperForRequestSerialization,
......@@ -587,6 +590,15 @@ public class MappingConfig implements GraphQLCodegenConfiguration, Combinable<Ma
this.parametrizedInputSuffix = parametrizedInputSuffix;
}
public void setGenerateAllMethodInProjection(Boolean generateAllMethodInProjection) {
this.generateAllMethodInProjection = generateAllMethodInProjection;
}
@Override
public Boolean getGenerateAllMethodInProjection() {
return generateAllMethodInProjection;
}
@Override
public Integer getResponseProjectionMaxDepth() {
return responseProjectionMaxDepth;
......
......@@ -48,6 +48,9 @@ public class MappingConfigConstants {
public static final String DEFAULT_RESPONSE_PROJECTION_SUFFIX = "ResponseProjection";
public static final String DEFAULT_PARAMETRIZED_INPUT_SUFFIX = "ParametrizedInput";
public static final String DEFAULT_GENERATE_ALL_METHOD_STRING = "true";
public static final boolean DEFAULT_GENERATE_ALL_METHOD = true;
public static final String DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH_STRING = "3";
public static final int DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH = 3;
......
......@@ -267,6 +267,11 @@ public class MappingContext implements GraphQLCodegenConfiguration {
return config.getResolverParentInterface();
}
@Override
public Boolean getGenerateAllMethodInProjection() {
return config.getGenerateAllMethodInProjection();
}
@Override
public Integer getResponseProjectionMaxDepth() {
return config.getResponseProjectionMaxDepth();
......
package com.kobylynskyi.graphql.codegen.model.graphql;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
/**
......@@ -14,39 +12,6 @@ public abstract class GraphQLResponseProjection {
protected final List<GraphQLResponseField> fields = new ArrayList<>();
/**
* save current depth for self recursive type.(it's actually a marker)
* such as
* {{@code
* type Human implements Character {
* id: ID!
* friends: [Character] # if you response this field on Human projection , Character has itself,
* # so, we need know depth of subquery.
* }
* interface Character {
* id: ID!
* friends: [Character]
* }
* }}
* Map Notes:
* `key` is parentProjection.childProjection.currentMethod. e.g. `CharacterResponseProjection
* .CharacterResponseProjection.friends` (excluding the first layer, so if only want the first child layer, use
* `all$(1)`)
* `value` is current depth for Character type. Each projection has a new instance of `projectionDepthOnFields`,
* so it always be `1` or `0`.
* and `responseProjectionMaxDepth` will reduce by recursive.
*/
protected final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
/**
* Defined at the parent level to use dynamic calls, default null.
*
* @return projection of all fields that are present in the given type
*/
public abstract GraphQLResponseProjection all$();
public abstract GraphQLResponseProjection all$(int maxDepth);
@Override
public String toString() {
if (fields.isEmpty()) {
......
......@@ -4,6 +4,10 @@ package ${package};
</#if>
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
<#if fields?has_content && generateAllMethodInProjection>
import java.util.HashMap;
import java.util.Map;
</#if>
<#if equalsAndHashCode>
import java.util.Objects;
</#if>
......@@ -25,17 +29,19 @@ import java.util.Objects;
@${annotation}
</#list>
public class ${className} extends GraphQLResponseProjection {
<#if fields?has_content && generateAllMethodInProjection>
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
</#if>
public ${className}() {
}
<#if fields?has_content>
<#if fields?has_content && generateAllMethodInProjection>
@Override
public ${className} all$() {
return all$(${responseProjectionMaxDepth});
}
@Override
public ${className} all$(int maxDepth) {
<#list fields as field>
<#if field.type?has_content>
......
......@@ -26,10 +26,12 @@ import java.util.Objects
</#list>
open class ${className} : GraphQLResponseProjection() {
<#if fields?has_content>
override fun `all$`(): ${className} = `all$`(${responseProjectionMaxDepth})
<#if fields?has_content && generateAllMethodInProjection>
private val projectionDepthOnFields: MutableMap<String, Int> by lazy { mutableMapOf<String, Int>() }
fun `all$`(): ${className} = `all$`(${responseProjectionMaxDepth})
override fun `all$`(maxDepth: Int): ${className} {
fun `all$`(maxDepth: Int): ${className} {
<#list fields as field>
<#if field.type?has_content>
<#if field.methodName?substring(0, 2) != "on">
......
......@@ -7,6 +7,9 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
<#if equalsAndHashCode>
import java.util.Objects
</#if>
<#if fields?has_content && generateAllMethodInProjection>
import scala.collection.mutable.HashMap
</#if>
<#if javaDoc?has_content>
/**
......@@ -26,16 +29,18 @@ import java.util.Objects
</#list>
class ${className} extends GraphQLResponseProjection {
<#if fields?has_content>
override def all$(): ${className} = all$(${responseProjectionMaxDepth})
<#if fields?has_content && generateAllMethodInProjection>
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
def all$(): ${className} = all$(${responseProjectionMaxDepth})
override def all$(maxDepth: Int): ${className} = {
def all$(maxDepth: Int): ${className} = {
<#list fields as field>
<#if field.type?has_content>
<#if field.methodName?substring(0, 2) != "on">
if (projectionDepthOnFields.getOrDefault("${className}.${field.type}.${field.methodName}", 0) <= maxDepth) {
projectionDepthOnFields.put("${className}.${field.type}.${field.methodName}", projectionDepthOnFields.getOrDefault("${className}.${field.type}.${field.methodName}", 0) + 1)
this.${field.methodName}(new ${field.type}().all$(maxDepth - projectionDepthOnFields.getOrDefault("${className}.${field.type}.${field.methodName}", 0)))
if (projectionDepthOnFields.getOrElse("${className}.${field.type}.${field.methodName}", 0) <= maxDepth) {
projectionDepthOnFields.put("${className}.${field.type}.${field.methodName}", projectionDepthOnFields.getOrElse("${className}.${field.type}.${field.methodName}", 0) + 1)
this.${field.methodName}(new ${field.type}().all$(maxDepth - projectionDepthOnFields.getOrElse("${className}.${field.type}.${field.methodName}", 0)))
}
</#if>
<#else>
......
......@@ -89,6 +89,19 @@ class GraphQLCodegenRequestTest {
getFileByName(files, "EventPropertyParentParametrizedInput.java"));
}
@Test
void generate_WithOutAllMethods() throws Exception {
mappingConfig.setGenerateAllMethodInProjection(false);
new JavaGraphQLCodegen(singletonList("src/test/resources/schemas/test.graphqls"),
outputBuildDir, mappingConfig, TestUtils.getStaticGeneratedInfo()).generate();
File[] files = Objects.requireNonNull(outputJavaClassesDir.listFiles());
assertSameTrimmedContent(new File("src/test/resources/expected-classes/request/" +
"EventResponseProjection.java_withoutAll.txt"),
getFileByName(files, "EventResponseProjection.java"));
}
@Test
void generate_PrimitivesInsideParametrizedInput() throws Exception {
new JavaGraphQLCodegen(singletonList("src/test/resources/schemas/parametrized-input-client.graphqls"),
......
......@@ -87,13 +87,11 @@ public class EventPropertyResponseProjection extends GraphQLResponseProjection {
return this;
}
@Override
public GraphQLResponseProjection all$() {
return null;
}
@Override
public GraphQLResponseProjection all$(int maxDepth) {
return null;
}
}
\ No newline at end of file
}
......@@ -83,13 +83,11 @@ public class EventResponseProjection extends GraphQLResponseProjection {
return this;
}
@Override
public GraphQLResponseProjection all$() {
return null;
}
@Override
public GraphQLResponseProjection all$(int maxDepth) {
return null;
}
}
\ No newline at end of file
}
......@@ -17,12 +17,10 @@ public class IssueResponseProjection extends GraphQLResponseProjection {
return this;
}
@Override
public GraphQLResponseProjection all$() {
return null;
}
@Override
public GraphQLResponseProjection all$(int maxDepth) {
return null;
}
......
......@@ -17,12 +17,10 @@ public class OrganizationResponseProjection extends GraphQLResponseProjection {
return this;
}
@Override
public GraphQLResponseProjection all$() {
return null;
}
@Override
public GraphQLResponseProjection all$(int maxDepth) {
return null;
}
......
......@@ -35,12 +35,10 @@ public class UpdateIssuePayloadResponseProjection extends GraphQLResponseProject
return this;
}
@Override
public GraphQLResponseProjection all$() {
return null;
}
@Override
public GraphQLResponseProjection all$(int maxDepth) {
return null;
}
......
......@@ -40,14 +40,11 @@ public class UpdateNodeUnionResponseProjection extends GraphQLResponseProjection
return this;
}
@Override
public GraphQLResponseProjection all$() {
return null;
}
@Override
public GraphQLResponseProjection all$(int maxDepth) {
return null;
}
}
\ No newline at end of file
}
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Event
......@@ -10,15 +12,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class EventResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public EventResponseProjection() {
}
@Override
public EventResponseProjection all$() {
return all$(3);
}
@Override
public EventResponseProjection all$(int maxDepth) {
this.typename();
return this;
......
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Asset
......@@ -10,15 +12,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class AssetResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public AssetResponseProjection() {
}
@Override
public AssetResponseProjection all$() {
return all$(3);
}
@Override
public AssetResponseProjection all$(int maxDepth) {
this.name();
this.status();
......@@ -74,4 +76,4 @@ public class AssetResponseProjection extends GraphQLResponseProjection {
}
}
\ No newline at end of file
}
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Event
......@@ -10,15 +12,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class EventResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public EventResponseProjection() {
}
@Override
public EventResponseProjection all$() {
return all$(3);
}
@Override
public EventResponseProjection all$(int maxDepth) {
this.status();
this.createdDateTime();
......@@ -87,4 +89,4 @@ public class EventResponseProjection extends GraphQLResponseProjection {
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.kobylynskyi.graphql.test1;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Product
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class ProductResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public ProductResponseProjection() {
}
@Override
public ProductResponseProjection all$() {
return all$(3);
}
@Override
public ProductResponseProjection all$(int maxDepth) {
this.id();
this.title();
......
......@@ -13,9 +13,11 @@ import java.util.Objects
)
open class SearchResultItemConnectionResponseProjection : GraphQLResponseProjection() {
override fun `all$`(): SearchResultItemConnectionResponseProjection = `all$`(3)
private val projectionDepthOnFields: MutableMap<String, Int> by lazy { mutableMapOf<String, Int>() }
override fun `all$`(maxDepth: Int): SearchResultItemConnectionResponseProjection {
fun `all$`(): SearchResultItemConnectionResponseProjection = `all$`(3)
fun `all$`(maxDepth: Int): SearchResultItemConnectionResponseProjection {
this.codeCount()
if (projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) <= maxDepth) {
projectionDepthOnFields["SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges"] = projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) + 1
......@@ -113,4 +115,4 @@ open class SearchResultItemConnectionResponseProjection : GraphQLResponseProject
override fun hashCode(): Int = Objects.hash(fields)
}
\ No newline at end of file
}
......@@ -13,9 +13,11 @@ import java.util.Objects
)
open class SearchResultItemResponseProjection : GraphQLResponseProjection() {
override fun `all$`(): SearchResultItemResponseProjection = `all$`(3)
private val projectionDepthOnFields: MutableMap<String, Int> by lazy { mutableMapOf<String, Int>() }
override fun `all$`(maxDepth: Int): SearchResultItemResponseProjection {
fun `all$`(): SearchResultItemResponseProjection = `all$`(3)
fun `all$`(maxDepth: Int): SearchResultItemResponseProjection {
this.typename()
return this
}
......@@ -89,4 +91,4 @@ open class SearchResultItemResponseProjection : GraphQLResponseProjection() {
override fun hashCode(): Int = Objects.hash(fields)
}
\ No newline at end of file
}
......@@ -10,9 +10,11 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
)
open class EventResponseProjection : GraphQLResponseProjection() {
override fun `all$`(): EventResponseProjection = `all$`(3)
private val projectionDepthOnFields: MutableMap<String, Int> by lazy { mutableMapOf<String, Int>() }
override fun `all$`(maxDepth: Int): EventResponseProjection {
fun `all$`(): EventResponseProjection = `all$`(3)
fun `all$`(maxDepth: Int): EventResponseProjection {
this.typename()
return this
}
......@@ -25,4 +27,4 @@ open class EventResponseProjection : GraphQLResponseProjection() {
}
}
\ No newline at end of file
}
......@@ -13,9 +13,11 @@ import java.util.Objects
)
open class CharResponseProjection : GraphQLResponseProjection() {
override fun `all$`(): CharResponseProjection = `all$`(3)
private val projectionDepthOnFields: MutableMap<String, Int> by lazy { mutableMapOf<String, Int>() }
override fun `all$`(maxDepth: Int): CharResponseProjection {
fun `all$`(): CharResponseProjection = `all$`(3)
fun `all$`(maxDepth: Int): CharResponseProjection {
this.typename()
return this
}
......@@ -40,4 +42,4 @@ open class CharResponseProjection : GraphQLResponseProjection() {
override fun hashCode(): Int = Objects.hash(fields)
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Location
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class LocationResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public LocationResponseProjection() {
}
@Override
public LocationResponseProjection all$() {
return all$(3);
}
@Override
public LocationResponseProjection all$(int maxDepth) {
this.id();
this.locationType();
......
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Vehicle
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class VehicleResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public VehicleResponseProjection() {
}
@Override
public VehicleResponseProjection all$() {
return all$(3);
}
@Override
public VehicleResponseProjection all$(int maxDepth) {
this.vehicleId();
this.registrationNumber();
......
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -13,15 +15,15 @@ import java.util.Objects;
)
public class CodeOfConductResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public CodeOfConductResponseProjection() {
}
@Override
public CodeOfConductResponseProjection all$() {
return all$(3);
}
@Override
public CodeOfConductResponseProjection all$(int maxDepth) {
this.body();
this.id();
......@@ -113,4 +115,4 @@ public class CodeOfConductResponseProjection extends GraphQLResponseProjection {
return Objects.hash(fields);
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -13,15 +15,15 @@ import java.util.Objects;
)
public class EventPropertyResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public EventPropertyResponseProjection() {
}
@Override
public EventPropertyResponseProjection all$() {
return all$(3);
}
@Override
public EventPropertyResponseProjection all$(int maxDepth) {
this.floatVal();
this.booleanVal();
......@@ -147,4 +149,4 @@ public class EventPropertyResponseProjection extends GraphQLResponseProjection {
return Objects.hash(fields);
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -13,15 +15,15 @@ import java.util.Objects;
)
public class EventResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public EventResponseProjection() {
}
@Override
public EventResponseProjection all$() {
return all$(3);
}
@Override
public EventResponseProjection all$(int maxDepth) {
this.id();
this.categoryId();
......@@ -136,4 +138,4 @@ public class EventResponseProjection extends GraphQLResponseProjection {
return Objects.hash(fields);
}
}
\ No newline at end of file
}
package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.Objects;
/**
* Response projection for Event
*/
@javax.annotation.Generated(
value = "com.kobylynskyi.graphql.codegen.GraphQLCodegen",
date = "2020-12-31T23:59:59-0500"
)
public class EventResponseProjection extends GraphQLResponseProjection {
public EventResponseProjection() {
}
public EventResponseProjection id() {
return id(null);
}
public EventResponseProjection id(String alias) {
fields.add(new GraphQLResponseField("id").alias(alias));
return this;
}
public EventResponseProjection categoryId() {
return categoryId(null);
}
public EventResponseProjection categoryId(String alias) {
fields.add(new GraphQLResponseField("categoryId").alias(alias));
return this;
}
public EventResponseProjection properties(EventPropertyResponseProjection subProjection) {
return properties(null, subProjection);
}
public EventResponseProjection properties(String alias, EventPropertyResponseProjection subProjection) {
fields.add(new GraphQLResponseField("properties").alias(alias).projection(subProjection));
return this;
}
public EventResponseProjection status() {
return status(null);
}
public EventResponseProjection status(String alias) {
fields.add(new GraphQLResponseField("status").alias(alias));
return this;
}
public EventResponseProjection createdBy() {
return createdBy(null);
}
public EventResponseProjection createdBy(String alias) {
fields.add(new GraphQLResponseField("createdBy").alias(alias));
return this;
}
public EventResponseProjection createdDateTime() {
return createdDateTime(null);
}
public EventResponseProjection createdDateTime(String alias) {
fields.add(new GraphQLResponseField("createdDateTime").alias(alias));
return this;
}
public EventResponseProjection active() {
return active(null);
}
public EventResponseProjection active(String alias) {
fields.add(new GraphQLResponseField("active").alias(alias));
return this;
}
public EventResponseProjection rating() {
return rating(null);
}
public EventResponseProjection rating(String alias) {
fields.add(new GraphQLResponseField("rating").alias(alias));
return this;
}
public EventResponseProjection typename() {
return typename(null);
}
public EventResponseProjection typename(String alias) {
fields.add(new GraphQLResponseField("__typename").alias(alias));
return this;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final EventResponseProjection that = (EventResponseProjection) obj;
return Objects.equals(fields, that.fields);
}
@Override
public int hashCode() {
return Objects.hash(fields);
}
}
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Location
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class LocationResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public LocationResponseProjection() {
}
@Override
public LocationResponseProjection all$() {
return all$(3);
}
@Override
public LocationResponseProjection all$(int maxDepth) {
this.id();
this.locationType();
......
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for SearchResultItemConnection
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class SearchResultItemConnectionResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public SearchResultItemConnectionResponseProjection() {
}
@Override
public SearchResultItemConnectionResponseProjection all$() {
return all$(3);
}
@Override
public SearchResultItemConnectionResponseProjection all$(int maxDepth) {
this.codeCount();
if (projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) <= maxDepth) {
......@@ -125,4 +127,4 @@ public class SearchResultItemConnectionResponseProjection extends GraphQLRespons
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for SearchResultItem
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class SearchResultItemResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public SearchResultItemResponseProjection() {
}
@Override
public SearchResultItemResponseProjection all$() {
return all$(3);
}
@Override
public SearchResultItemResponseProjection all$(int maxDepth) {
this.typename();
return this;
......@@ -99,4 +101,4 @@ public class SearchResultItemResponseProjection extends GraphQLResponseProjectio
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.github.graphql;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
/**
* Response projection for Vehicle
......@@ -12,15 +14,15 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
)
public class VehicleResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public VehicleResponseProjection() {
}
@Override
public VehicleResponseProjection all$() {
return all$(3);
}
@Override
public VehicleResponseProjection all$(int maxDepth) {
this.vehicleId();
this.registrationNumber();
......@@ -69,4 +71,4 @@ public class VehicleResponseProjection extends GraphQLResponseProjection {
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.kobylynskyi.graphql.codegen.prot;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -13,15 +15,15 @@ import java.util.Objects;
)
public class CharResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public CharResponseProjection() {
}
@Override
public CharResponseProjection all$() {
return all$(3);
}
@Override
public CharResponseProjection all$(int maxDepth) {
this.typename();
return this;
......
......@@ -2,6 +2,8 @@ package com.kobylynskyi.graphql.codegen.prot;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -13,15 +15,15 @@ import java.util.Objects;
)
public class QueryResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public QueryResponseProjection() {
}
@Override
public QueryResponseProjection all$() {
return all$(3);
}
@Override
public QueryResponseProjection all$(int maxDepth) {
this.Native();
if (projectionDepthOnFields.getOrDefault("QueryResponseProjection.SynchronizedResponseProjection.Private", 0) <= maxDepth) {
......@@ -104,4 +106,4 @@ public class QueryResponseProjection extends GraphQLResponseProjection {
return Objects.hash(fields);
}
}
\ No newline at end of file
}
......@@ -2,6 +2,8 @@ package com.kobylynskyi.graphql.codegen.prot;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField;
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
......@@ -13,15 +15,15 @@ import java.util.Objects;
)
public class SynchronizedResponseProjection extends GraphQLResponseProjection {
private final Map<String, Integer> projectionDepthOnFields = new HashMap<>();
public SynchronizedResponseProjection() {
}
@Override
public SynchronizedResponseProjection all$() {
return all$(3);
}
@Override
public SynchronizedResponseProjection all$(int maxDepth) {
this.Void();
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.Wait", 0) <= maxDepth) {
......@@ -76,4 +78,4 @@ public class SynchronizedResponseProjection extends GraphQLResponseProjection {
return Objects.hash(fields);
}
}
\ No newline at end of file
}
......@@ -3,6 +3,7 @@ package com.github.graphql
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
import java.util.Objects
import scala.collection.mutable.HashMap
/**
* Response projection for SearchResultItemConnection
......@@ -13,22 +14,24 @@ import java.util.Objects
)
class SearchResultItemConnectionResponseProjection extends GraphQLResponseProjection {
override def all$(): SearchResultItemConnectionResponseProjection = all$(3)
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
override def all$(maxDepth: Int): SearchResultItemConnectionResponseProjection = {
def all$(): SearchResultItemConnectionResponseProjection = all$(3)
def all$(maxDepth: Int): SearchResultItemConnectionResponseProjection = {
this.codeCount()
if (projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) <= maxDepth) {
projectionDepthOnFields.put("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) + 1)
this.edges(new SearchResultItemEdgeResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0)))
if (projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) <= maxDepth) {
projectionDepthOnFields.put("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0) + 1)
this.edges(new SearchResultItemEdgeResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.SearchResultItemEdgeResponseProjection.edges", 0)))
}
this.issueCount()
if (projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", 0) <= maxDepth) {
projectionDepthOnFields.put("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", 0) + 1)
this.nodes(new SearchResultItemResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", 0)))
if (projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", 0) <= maxDepth) {
projectionDepthOnFields.put("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", 0) + 1)
this.nodes(new SearchResultItemResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.SearchResultItemResponseProjection.nodes", 0)))
}
if (projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", 0) <= maxDepth) {
projectionDepthOnFields.put("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", 0) + 1)
this.pageInfo(new PageInfoResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", 0)))
if (projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", 0) <= maxDepth) {
projectionDepthOnFields.put("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", 0) + 1)
this.pageInfo(new PageInfoResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SearchResultItemConnectionResponseProjection.PageInfoResponseProjection.pageInfo", 0)))
}
this.repositoryCount()
this.userCount()
......
......@@ -3,6 +3,7 @@ package com.github.graphql
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
import java.util.Objects
import scala.collection.mutable.HashMap
/**
* Response projection for SearchResultItem
......@@ -13,9 +14,11 @@ import java.util.Objects
)
class SearchResultItemResponseProjection extends GraphQLResponseProjection {
override def all$(): SearchResultItemResponseProjection = all$(3)
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
override def all$(maxDepth: Int): SearchResultItemResponseProjection = {
def all$(): SearchResultItemResponseProjection = all$(3)
def all$(maxDepth: Int): SearchResultItemResponseProjection = {
this.typename()
this
}
......
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
import scala.collection.mutable.HashMap
/**
* Response projection for Event
......@@ -10,9 +11,11 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
)
class EventResponseProjection extends GraphQLResponseProjection {
override def all$(): EventResponseProjection = all$(3)
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
override def all$(maxDepth: Int): EventResponseProjection = {
def all$(): EventResponseProjection = all$(3)
def all$(maxDepth: Int): EventResponseProjection = {
this.typename()
this
}
......@@ -27,4 +30,4 @@ class EventResponseProjection extends GraphQLResponseProjection {
}
}
\ No newline at end of file
}
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
import scala.collection.mutable.HashMap
/**
* Response projection for Asset
......@@ -10,9 +11,11 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
)
class AssetResponseProjection extends GraphQLResponseProjection {
override def all$(): AssetResponseProjection = all$(3)
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
override def all$(maxDepth: Int): AssetResponseProjection = {
def all$(): AssetResponseProjection = all$(3)
def all$(maxDepth: Int): AssetResponseProjection = {
this.name()
this.status()
this.id()
......
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
import scala.collection.mutable.HashMap
/**
* Response projection for Event
......@@ -10,14 +11,16 @@ import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
)
class EventResponseProjection extends GraphQLResponseProjection {
override def all$(): EventResponseProjection = all$(3)
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
override def all$(maxDepth: Int): EventResponseProjection = {
def all$(): EventResponseProjection = all$(3)
def all$(maxDepth: Int): EventResponseProjection = {
this.status()
this.createdDateTime()
if (projectionDepthOnFields.getOrDefault("EventResponseProjection.AssetResponseProjection.assets", 0) <= maxDepth) {
projectionDepthOnFields.put("EventResponseProjection.AssetResponseProjection.assets", projectionDepthOnFields.getOrDefault("EventResponseProjection.AssetResponseProjection.assets", 0) + 1)
this.assets(new AssetResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("EventResponseProjection.AssetResponseProjection.assets", 0)))
if (projectionDepthOnFields.getOrElse("EventResponseProjection.AssetResponseProjection.assets", 0) <= maxDepth) {
projectionDepthOnFields.put("EventResponseProjection.AssetResponseProjection.assets", projectionDepthOnFields.getOrElse("EventResponseProjection.AssetResponseProjection.assets", 0) + 1)
this.assets(new AssetResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("EventResponseProjection.AssetResponseProjection.assets", 0)))
}
this.id()
this.createdBy()
......
......@@ -3,6 +3,7 @@ package com.kobylynskyi.graphql.codegen.prot
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseField
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLResponseProjection
import java.util.Objects
import scala.collection.mutable.HashMap
/**
* Response projection for Synchronized
......@@ -13,38 +14,40 @@ import java.util.Objects
)
class SynchronizedResponseProjection extends GraphQLResponseProjection {
override def all$(): SynchronizedResponseProjection = all$(3)
private final lazy val projectionDepthOnFields = new HashMap[String, Int]
override def all$(maxDepth: Int): SynchronizedResponseProjection = {
def all$(): SynchronizedResponseProjection = all$(3)
def all$(maxDepth: Int): SynchronizedResponseProjection = {
this.void()
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.Wait", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.Wait", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.Wait", 0) + 1)
this.Wait(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.Wait", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.Wait", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.Wait", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.Wait", 0) + 1)
this.Wait(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.Wait", 0)))
}
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`this`", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.`this`", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`this`", 0) + 1)
this.`this`(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`this`", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`this`", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.`this`", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`this`", 0) + 1)
this.`this`(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`this`", 0)))
}
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`super`", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.`super`", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`super`", 0) + 1)
this.`super`(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`super`", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`super`", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.`super`", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`super`", 0) + 1)
this.`super`(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`super`", 0)))
}
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`private`", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.`private`", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`private`", 0) + 1)
this.`private`(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.`private`", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`private`", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.`private`", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`private`", 0) + 1)
this.`private`(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.`private`", 0)))
}
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.native", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.native", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.native", 0) + 1)
this.native(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.native", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.native", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.native", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.native", 0) + 1)
this.native(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.native", 0)))
}
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.that", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.that", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.that", 0) + 1)
this.that(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.CharResponseProjection.that", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.that", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.CharResponseProjection.that", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.that", 0) + 1)
this.that(new CharResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.CharResponseProjection.that", 0)))
}
this.enum()
if (projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", 0) + 1)
this.Synchronized(new SynchronizedResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrDefault("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", 0)))
if (projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", 0) <= maxDepth) {
projectionDepthOnFields.put("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", 0) + 1)
this.Synchronized(new SynchronizedResponseProjection().all$(maxDepth - projectionDepthOnFields.getOrElse("SynchronizedResponseProjection.SynchronizedResponseProjection.Synchronized", 0)))
}
this.date()
this.typename()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册