diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8321ba1d883..128f72d96b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,11 +68,19 @@ Logging & Error messages * There is one exception for the Gradle plugin. It is allowed to log information though the lifecycle() methods. * Messages should contain "Apollo: " when it's not immediately clear that the message comes from Apollo. +Gradle APIs + +Gradle is a bit peculiar because it can be used from both Kotlin and Groovy, has lazy and eager APIs and can sometimes be used as a DSL and sometimes imperatively. The rules we landed on are: + +* Lazy properties use names. Example: `packageName.set("com.example")` +* Methods with one or more parameters use verbs. Example: `mapScalar("ID", "kotlin.Long")` +* Except when there is only one parameter that is of `Action` type. Example: `introspection {}` + Misc * Parameters using milliseconds should have the "Millis" suffix. * Else use [kotlin.time.Duration] * `ExperimentalContracts` is ok to use. Since kotlin-stdlib does it, we can too. See https://github.com/Kotlin/KEEP/blob/master/proposals/kotlin-contracts.md#compatibility-notice - + ## Workflow We love Github issues! Before working on any new features, please open an issue so that we can agree on the direction, diff --git a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/CompiledGraphQL.kt b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/CompiledGraphQL.kt index 20d7b7aaa08..796260d86c5 100644 --- a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/CompiledGraphQL.kt +++ b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/CompiledGraphQL.kt @@ -2,6 +2,8 @@ package com.apollographql.apollo3.api +import com.apollographql.apollo3.annotations.ApolloDeprecatedSince +import com.apollographql.apollo3.annotations.ApolloDeprecatedSince.Version.v3_0_1 import com.apollographql.apollo3.annotations.ApolloInternal import com.apollographql.apollo3.api.json.BufferedSinkJsonWriter import com.apollographql.apollo3.api.json.writeAny @@ -239,22 +241,32 @@ fun resolveVariables(value: Any?, variables: Executable.Variables): Any? { } } +@Deprecated("Use the generated CustomScalarType instead") +@ApolloDeprecatedSince(v3_0_1) @SharedImmutable @JvmField val CompiledStringType = ScalarType("String") +@Deprecated("Use the generated CustomScalarType instead") +@ApolloDeprecatedSince(v3_0_1) @SharedImmutable @JvmField val CompiledIntType = ScalarType("Int") +@Deprecated("Use the generated CustomScalarType instead") +@ApolloDeprecatedSince(v3_0_1) @SharedImmutable @JvmField val CompiledFloatType = ScalarType("Float") +@Deprecated("Use the generated CustomScalarType instead") +@ApolloDeprecatedSince(v3_0_1) @SharedImmutable @JvmField val CompiledBooleanType = ScalarType("Boolean") +@Deprecated("Use the generated CustomScalarType instead") +@ApolloDeprecatedSince(v3_0_1) @SharedImmutable @JvmField val CompiledIDType = ScalarType("ID") diff --git a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Upload.kt b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Upload.kt index 92e24a1befe..08be5d89790 100644 --- a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Upload.kt +++ b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Upload.kt @@ -9,9 +9,10 @@ import okio.BufferedSink * Use this to map your upload custom scalar and the apollo runtime will be able to extract them * and send them out of band. * - * customScalarsMapping.set(mapOf( - * "Upload" to "com.apollographql.apollo3.api.Upload" - * )) + * In your build.gradle file: + * ``` + * mapScalarToUpload(Upload) + * ``` * * If you have a JVM File at hand, see also [com.apollographql.apollo3.api.DefaultUpload.Builder.content] */ diff --git a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/test/TestResolver.kt b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/test/TestResolver.kt index 7317f184016..51feb811865 100644 --- a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/test/TestResolver.kt +++ b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/test/TestResolver.kt @@ -95,9 +95,6 @@ open class DefaultTestResolver : TestResolver { } } is CustomScalarType -> { - resolveCustomScalar(path) - } - is CompiledNamedType -> { when (compiledType.name) { "Int" -> resolveInt(path) "Float" -> resolveFloat(path) @@ -105,10 +102,13 @@ open class DefaultTestResolver : TestResolver { "String" -> resolveString(path) "ID" -> resolveString(path) else -> { - resolveComposite(path, ctors ?: error("no ctors for $responseName")) + resolveCustomScalar(path) } } } + is CompiledNamedType -> { + resolveComposite(path, ctors ?: error("no ctors for $responseName")) + } } as T } diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloCompiler.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloCompiler.kt index fa23ae85aa6..0757ffd640f 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloCompiler.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloCompiler.kt @@ -47,7 +47,7 @@ object ApolloCompiler { "enclosing one.") } - checkCustomScalars(schema, options.customScalarsMapping) + checkCustomScalars(schema, options.scalarMapping) outputDir.deleteRecursively() outputDir.mkdirs() @@ -142,7 +142,7 @@ object ApolloCompiler { fragmentDefinitions = fragments, allFragmentDefinitions = allFragmentDefinitions, alwaysGenerateTypesMatching = alwaysGenerateTypesMatching, - customScalarsMapping = options.customScalarsMapping, + scalarMapping = options.scalarMapping, codegenModels = options.codegenModels, generateOptionalOperationVariables = options.generateOptionalOperationVariables ).build() @@ -186,7 +186,9 @@ object ApolloCompiler { generateFragmentImplementations = options.generateFragmentImplementations, generateQueryDocument = options.generateQueryDocument, generateSchema = options.generateSchema, + generatedSchemaName = options.generatedSchemaName, flatten = options.flattenModels, + scalarMapping = options.scalarMapping, ).write(outputDir = outputDir) } else -> { @@ -203,22 +205,23 @@ object ApolloCompiler { generateFragmentImplementations = options.generateFragmentImplementations, generateQueryDocument = options.generateQueryDocument, generateSchema = options.generateSchema, + generatedSchemaName = options.generatedSchemaName, generateTestBuilders = options.generateTestBuilders, flatten = options.flattenModels, sealedClassesForEnumsMatching = options.sealedClassesForEnumsMatching, targetLanguageVersion = options.targetLanguage, + scalarMapping = options.scalarMapping, ).write(outputDir = outputDir, testDir = testDir) } } - return CompilerMetadata( fragments = fragments, resolverInfo = outputResolverInfo, ) } - private fun checkCustomScalars(schema: Schema, customScalarsMapping: Map) { + private fun checkCustomScalars(schema: Schema, scalarMapping: Map) { /** * Generate the mapping for all custom scalars * @@ -228,10 +231,9 @@ object ApolloCompiler { .typeDefinitions .values .filterIsInstance() - .filter { !it.isBuiltIn() } .map { type -> type.name } .toSet() - val unknownScalars = customScalarsMapping.keys.subtract(schemaScalars) + val unknownScalars = scalarMapping.keys.subtract(schemaScalars) check(unknownScalars.isEmpty()) { "Apollo: unknown custom scalar(s) in customScalarsMapping: ${unknownScalars.joinToString(",")}" } diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloMetadata.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloMetadata.kt index 44ada95fe74..19ea67358c5 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloMetadata.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ApolloMetadata.kt @@ -6,7 +6,6 @@ import com.apollographql.apollo3.ast.Schema import com.apollographql.apollo3.ast.parseAsGQLDocument import com.apollographql.apollo3.ast.toSchema import com.apollographql.apollo3.ast.toUtf8 -import com.apollographql.apollo3.ast.validateAsSchema import com.apollographql.apollo3.compiler.codegen.ResolverInfo import com.squareup.moshi.JsonAdapter import com.squareup.moshi.JsonClass @@ -89,6 +88,10 @@ data class CommonMetadata( val schemaPackageName: String, val pluginVersion: String, val codegenModels: String, + /** + * Scalar mapping needed for scalars' target types and Adapter initializers + */ + val scalarMapping: Map, ) /** @@ -106,5 +109,5 @@ data class CompilerMetadata( /** * resolver info used by the codegen to lookup already existing ClassNames */ - val resolverInfo: ResolverInfo + val resolverInfo: ResolverInfo, ) diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/IncomingOptions.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/IncomingOptions.kt index 7bb34361447..84e191c9af3 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/IncomingOptions.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/IncomingOptions.kt @@ -22,14 +22,6 @@ class IncomingOptions( val schemaPackageName: String, ) { companion object { - fun fromMetadata(commonMetadata: CommonMetadata): IncomingOptions { - return IncomingOptions( - schema = commonMetadata.schema, - codegenModels = commonMetadata.codegenModels, - schemaPackageName = commonMetadata.schemaPackageName - ) - } - @OptIn(ApolloExperimental::class) fun resolveSchema(schemaFiles: Collection, rootFolders: List): Pair { check(schemaFiles.isNotEmpty()) { diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Options.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Options.kt index f7c5807f718..0cf04c69d90 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Options.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/Options.kt @@ -7,6 +7,8 @@ import com.apollographql.apollo3.ast.Schema import com.apollographql.apollo3.ast.toSchema import com.apollographql.apollo3.compiler.introspection.toGQLDocument import com.apollographql.apollo3.compiler.introspection.toSchema +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.sealed.annotations.TypeLabel import java.io.File @@ -85,7 +87,7 @@ class Options( val targetLanguage: TargetLanguage = defaultTargetLanguage, //========== codegen options ============ - val customScalarsMapping: Map = defaultCustomScalarsMapping, + val scalarMapping: Map = defaultScalarMapping, val codegenModels: String = defaultCodegenModels, val flattenModels: Boolean = defaultFlattenModels, val useSemanticNaming: Boolean = defaultUseSemanticNaming, @@ -121,12 +123,24 @@ class Options( val generateQueryDocument: Boolean = defaultGenerateQueryDocument, /** - * Whether to generate the __Schema class. + * Whether to generate the Schema class. * - * __Schema is a special class that contains a list of all composite types (objects, interfaces, unions) - * It can be used to retrieve the list of possible types for a given CompiledType + * The Schema class is a special class that contains a list of all composite types (objects, interfaces, unions). + * It can be used to retrieve the list of possible types for a given CompiledType. + * + * Its name can be configured with [generatedSchemaName]. + * + * Default: false */ val generateSchema: Boolean = defaultGenerateSchema, + + /** + * Class name to use when generating the Schema class. + * + * Default: "__Schema" + */ + val generatedSchemaName: String = defaultGeneratedSchemaName, + /** * Whether to generate the type safe Data builders. These are mainly used for tests but can also be used for other use * cases too. @@ -190,7 +204,7 @@ class Options( alwaysGenerateTypesMatching: Set = this.alwaysGenerateTypesMatching, operationOutputGenerator: OperationOutputGenerator = this.operationOutputGenerator, incomingCompilerMetadata: List = this.incomingCompilerMetadata, - customScalarsMapping: Map = this.customScalarsMapping, + scalarMapping: Map = this.scalarMapping, codegenModels: String = this.codegenModels, flattenModels: Boolean = this.flattenModels, useSemanticNaming: Boolean = this.useSemanticNaming, @@ -203,6 +217,7 @@ class Options( generateResponseFields: Boolean = this.generateResponseFields, generateQueryDocument: Boolean = this.generateQueryDocument, generateSchema: Boolean = this.generateSchema, + generatedSchemaName: String = this.generatedSchemaName, moduleName: String = this.moduleName, targetLanguage: TargetLanguage = this.targetLanguage, generateTestBuilders: Boolean = this.generateTestBuilders, @@ -221,7 +236,7 @@ class Options( operationOutputGenerator = operationOutputGenerator, incomingCompilerMetadata = incomingCompilerMetadata, targetLanguage = targetLanguage, - customScalarsMapping = customScalarsMapping, + scalarMapping = scalarMapping, codegenModels = codegenModels, flattenModels = flattenModels, useSemanticNaming = useSemanticNaming, @@ -234,17 +249,18 @@ class Options( generateResponseFields = generateResponseFields, generateQueryDocument = generateQueryDocument, generateSchema = generateSchema, + generatedSchemaName = generatedSchemaName, moduleName = moduleName, generateTestBuilders = generateTestBuilders, testDir = testDir, - sealedClassesForEnumsMatching = sealedClassesForEnumsMatching, + sealedClassesForEnumsMatching = sealedClassesForEnumsMatching, generateOptionalOperationVariables = generateOptionalOperationVariables, ) companion object { val defaultAlwaysGenerateTypesMatching = emptySet() val defaultOperationOutputGenerator = OperationOutputGenerator.Default(OperationIdGenerator.Sha256) - val defaultCustomScalarsMapping = emptyMap() + val defaultScalarMapping = emptyMap() val defaultLogger = ApolloCompiler.NoOpLogger const val defaultUseSemanticNaming = true const val defaultWarnOnDeprecatedUsages = true @@ -260,6 +276,7 @@ class Options( const val defaultFlattenModels = true val defaultTargetLanguage = TargetLanguage.KOTLIN_1_5 const val defaultGenerateSchema = false + const val defaultGeneratedSchemaName = "__Schema" const val defaultGenerateTestBuilders = false val defaultSealedClassesForEnumsMatching = emptyList() const val defaultGenerateOptionalOperationVariables = true @@ -267,3 +284,26 @@ class Options( } } +/** + * Controls how scalar adapters are used in the generated code. + */ +@JsonClass(generateAdapter = true, generator = "sealed:type") +sealed interface AdapterInitializer + +/** + * The adapter expression will be used as-is (can be an object, a public val, a class instantiation). + * + * e.g. `"com.example.MyAdapter"` or `"com.example.MyAdapter()"`. + */ +@TypeLabel("Expression") +@JsonClass(generateAdapter = true) +class ExpressionAdapterInitializer(val expression: String) : AdapterInitializer + +/** + * The adapter instance will be looked up in the [com.apollographql.apollo3.api.CustomScalarAdapters] provided at runtime. + */ +@TypeLabel("Runtime") +object RuntimeAdapterInitializer : AdapterInitializer + +@JsonClass(generateAdapter = true) +data class ScalarInfo(val targetName: String, val adapterInitializer: AdapterInitializer = RuntimeAdapterInitializer) diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/CodegenLayout.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/CodegenLayout.kt index c5a28ef4226..08c455e239b 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/CodegenLayout.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/CodegenLayout.kt @@ -87,7 +87,6 @@ abstract class CodegenLayout( // variables keep the same case as their declared name internal fun variableName(name: String) = regularIdentifier(name) internal fun propertyName(name: String) = regularIdentifier(name) - internal fun schemaName() = "__Schema" // ------------------------ Helpers --------------------------------- diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/Resolver.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/Resolver.kt index ca29ef29aba..2943e708815 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/Resolver.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/Resolver.kt @@ -29,11 +29,6 @@ enum class ResolverKeyKind { Fragment, FragmentVariablesAdapter, FragmentSelections, - /** - * CustomScalarTarget is a special case as there is no real generated reference pointing to it. - * Instead it is a String in [CustomScalarType.className] - */ - CustomScalarTarget, TestBuilder } @@ -47,4 +42,4 @@ class ResolverInfo( val magic: String, val version: String, val entries: List -) \ No newline at end of file +) diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaCodeGen.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaCodeGen.kt index 71aecd9531c..de876535545 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaCodeGen.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaCodeGen.kt @@ -2,6 +2,7 @@ package com.apollographql.apollo3.compiler.codegen.java import com.apollographql.apollo3.compiler.APOLLO_VERSION import com.apollographql.apollo3.compiler.PackageNameGenerator +import com.apollographql.apollo3.compiler.ScalarInfo import com.apollographql.apollo3.compiler.codegen.ResolverInfo import com.apollographql.apollo3.compiler.codegen.java.adapter.EnumResponseAdapterBuilder import com.apollographql.apollo3.compiler.codegen.java.file.CustomScalarBuilder @@ -44,12 +45,14 @@ class JavaCodeGen( private val generateFragmentImplementations: Boolean, private val generateQueryDocument: Boolean, private val generateSchema: Boolean, + private val generatedSchemaName: String, /** * Whether to flatten the models. This decision is left to the codegen. For fragments for an example, we * want to flatten at depth 1 to avoid name clashes, but it's ok to flatten fragment response adapters at * depth 0 */ private val flatten: Boolean, + private val scalarMapping: Map, ) { /** * @param outputDir: the directory where to write the Kotlin files @@ -57,7 +60,7 @@ class JavaCodeGen( */ fun write(outputDir: File): ResolverInfo { val upstreamResolver = resolverInfos.fold(null as JavaResolver?) { acc, resolverInfo -> - JavaResolver(resolverInfo.entries, acc) + JavaResolver(resolverInfo.entries, acc, scalarMapping) } val layout = JavaCodegenLayout( @@ -69,7 +72,7 @@ class JavaCodeGen( val context = JavaContext( layout = layout, - resolver = JavaResolver(emptyList(), upstreamResolver) + resolver = JavaResolver(emptyList(), upstreamResolver, scalarMapping) ) val builders = mutableListOf() @@ -159,7 +162,7 @@ class JavaCodeGen( } if (generateSchema) { - builders.add(SchemaBuilder(context, ir.objects, ir.interfaces, ir.unions)) + builders.add(SchemaBuilder(context, generatedSchemaName, ir.objects, ir.interfaces, ir.unions)) } builders.forEach { it.prepare() } diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaResolver.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaResolver.kt index 19018162131..7228b06ea2f 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaResolver.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaResolver.kt @@ -1,5 +1,8 @@ package com.apollographql.apollo3.compiler.codegen.java +import com.apollographql.apollo3.compiler.ExpressionAdapterInitializer +import com.apollographql.apollo3.compiler.RuntimeAdapterInitializer +import com.apollographql.apollo3.compiler.ScalarInfo import com.apollographql.apollo3.compiler.codegen.Identifier.customScalarAdapters import com.apollographql.apollo3.compiler.codegen.Identifier.type import com.apollographql.apollo3.compiler.codegen.ResolverClassName @@ -7,7 +10,6 @@ import com.apollographql.apollo3.compiler.codegen.ResolverEntry import com.apollographql.apollo3.compiler.codegen.ResolverKey import com.apollographql.apollo3.compiler.codegen.ResolverKeyKind import com.apollographql.apollo3.compiler.codegen.java.adapter.singletonAdapterInitializer -import com.apollographql.apollo3.compiler.ir.IrScalarType import com.apollographql.apollo3.compiler.ir.IrEnumType import com.apollographql.apollo3.compiler.ir.IrInputObjectType import com.apollographql.apollo3.compiler.ir.IrListType @@ -15,6 +17,7 @@ import com.apollographql.apollo3.compiler.ir.IrModelType import com.apollographql.apollo3.compiler.ir.IrNamedType import com.apollographql.apollo3.compiler.ir.IrNonNullType import com.apollographql.apollo3.compiler.ir.IrOptionalType +import com.apollographql.apollo3.compiler.ir.IrScalarType import com.apollographql.apollo3.compiler.ir.IrType import com.squareup.javapoet.ClassName import com.squareup.javapoet.CodeBlock @@ -22,7 +25,7 @@ import com.squareup.javapoet.ParameterizedTypeName import com.squareup.javapoet.TypeName -class JavaResolver(entries: List, val next: JavaResolver?) { +class JavaResolver(entries: List, val next: JavaResolver?, private val scalarMapping: Map) { fun resolve(key: ResolverKey): ClassName? = classNames[key] ?: next?.resolve(key) private var classNames = entries.associateBy( @@ -54,33 +57,35 @@ class JavaResolver(entries: List, val next: JavaResolver?) { is IrOptionalType -> ParameterizedTypeName.get(JavaClassNames.Optional, resolveIrType(type.ofType)) is IrListType -> ParameterizedTypeName.get(JavaClassNames.List, resolveIrType(type.ofType)) is IrModelType -> resolveAndAssert(ResolverKeyKind.Model, type.path) - is IrScalarType -> { - when (type.name) { - "String" -> JavaClassNames.String - "ID" -> JavaClassNames.String - "Float" -> JavaClassNames.Double - "Int" -> JavaClassNames.Integer - "Boolean" -> JavaClassNames.Boolean - else -> { - resolve(ResolverKeyKind.CustomScalarTarget, type.name) ?: JavaClassNames.Object - } - } - - } + is IrScalarType -> resolveIrScalarType(type) is IrNamedType -> resolveAndAssert(ResolverKeyKind.SchemaType, type.name) else -> error("$type is not a schema type") } } + private fun resolveIrScalarType(type: IrScalarType): ClassName { + // Try mapping first, then built-ins, then fallback to Object + return resolveScalarTaget(type.name) ?: when (type.name) { + "String" -> JavaClassNames.String + "ID" -> JavaClassNames.String + "Float" -> JavaClassNames.Double + "Int" -> JavaClassNames.Integer + "Boolean" -> JavaClassNames.Boolean + else -> JavaClassNames.Object + } + } + fun adapterInitializer(type: IrType, requiresBuffering: Boolean): CodeBlock { if (type !is IrNonNullType) { + // Don't hardcode the adapter when the scalar is mapped to a user-defined type + val scalarWithoutCustomMapping = type is IrScalarType && !scalarMapping.containsKey(type.name) return when { - type is IrScalarType && type.name == "String" -> adapterCodeBlock("NullableStringAdapter") - type is IrScalarType && type.name == "ID" -> adapterCodeBlock("NullableStringAdapter") - type is IrScalarType && type.name == "Boolean" -> adapterCodeBlock("NullableBooleanAdapter") - type is IrScalarType && type.name == "Int" -> adapterCodeBlock("NullableIntAdapter") - type is IrScalarType && type.name == "Float" -> adapterCodeBlock("NullableDoubleAdapter") - type is IrScalarType && resolve(ResolverKeyKind.CustomScalarTarget, type.name) == null -> { + type is IrScalarType && type.name == "String" && scalarWithoutCustomMapping -> adapterCodeBlock("NullableStringAdapter") + type is IrScalarType && type.name == "ID" && scalarWithoutCustomMapping -> adapterCodeBlock("NullableStringAdapter") + type is IrScalarType && type.name == "Boolean" && scalarWithoutCustomMapping -> adapterCodeBlock("NullableBooleanAdapter") + type is IrScalarType && type.name == "Int" && scalarWithoutCustomMapping -> adapterCodeBlock("NullableIntAdapter") + type is IrScalarType && type.name == "Float" && scalarWithoutCustomMapping -> adapterCodeBlock("NullableDoubleAdapter") + type is IrScalarType && resolveScalarTaget(type.name) == null -> { adapterCodeBlock("NullableAnyAdapter") } else -> { @@ -91,13 +96,14 @@ class JavaResolver(entries: List, val next: JavaResolver?) { return nonNullableAdapterInitializer(type.ofType, requiresBuffering) } + fun resolveScalarTaget(name: String): ClassName? { + return scalarMapping.get(name)?.targetName?.let { + ClassName.bestGuess(it) + } + } + fun resolveCompiledType(name: String): CodeBlock { val builtin = when (name) { - "String" -> "CompiledStringType" - "Int" -> "CompiledIntType" - "Float" -> "CompiledFloatType" - "Boolean" -> "CompiledBooleanType" - "ID" -> "CompiledIDType" "__Schema" -> "CompiledSchemaType" "__Type" -> "CompiledTypeType" "__Field" -> "CompiledFieldType" @@ -120,22 +126,8 @@ class JavaResolver(entries: List, val next: JavaResolver?) { type is IrListType -> { CodeBlock.of("new $T<>($L)", JavaClassNames.ListAdapter, adapterInitializer(type.ofType, requiresBuffering)) } - type is IrScalarType && type.name == "Boolean" -> adapterCodeBlock("BooleanAdapter") - type is IrScalarType && type.name == "ID" -> adapterCodeBlock("StringAdapter") - type is IrScalarType && type.name == "String" -> adapterCodeBlock("StringAdapter") - type is IrScalarType && type.name == "Int" -> adapterCodeBlock("IntAdapter") - type is IrScalarType && type.name == "Float" -> adapterCodeBlock("DoubleAdapter") type is IrScalarType -> { - val target = resolve(ResolverKeyKind.CustomScalarTarget, type.name) - if (target == null) { - adapterCodeBlock("AnyAdapter") - } else { - CodeBlock.of( - "($customScalarAdapters.<$T>responseAdapterFor($L))", - target, - resolveCompiledType(type.name) - ) - } + nonNullableScalarAdapterInitializer(type) } type is IrEnumType -> { CodeBlock.of("$T.INSTANCE", resolveAndAssert(ResolverKeyKind.SchemaTypeAdapter, type.name)) @@ -161,6 +153,43 @@ class JavaResolver(entries: List, val next: JavaResolver?) { } } + private fun nonNullableScalarAdapterInitializer(type: IrScalarType): CodeBlock { + return when (val adapterInitializer = scalarMapping[type.name]?.adapterInitializer) { + is ExpressionAdapterInitializer -> { + CodeBlock.of(adapterInitializer.expression) + } + is RuntimeAdapterInitializer -> { + val target = resolveScalarTaget(type.name) + CodeBlock.of( + "($customScalarAdapters.<$T>responseAdapterFor($L))", + target, + resolveCompiledType(type.name) + ) + } + else -> { + when (type.name) { + "Boolean" -> adapterCodeBlock("BooleanAdapter") + "ID" -> adapterCodeBlock("StringAdapter") + "String" -> adapterCodeBlock("StringAdapter") + "Int" -> adapterCodeBlock("IntAdapter") + "Float" -> adapterCodeBlock("DoubleAdapter") + else -> { + val target = resolveScalarTaget(type.name) + if (target == null) { + adapterCodeBlock("AnyAdapter") + } else { + CodeBlock.of( + "($customScalarAdapters.<$T>responseAdapterFor($L))", + target, + resolveCompiledType(type.name) + ) + } + } + } + } + } + } + /** * Nullable adapters are @JvmField properties */ @@ -208,7 +237,6 @@ class JavaResolver(entries: List, val next: JavaResolver?) { fun resolveSchemaType(name: String) = resolveAndAssert(ResolverKeyKind.SchemaType, name) fun registerSchemaType(name: String, className: ClassName) = register(ResolverKeyKind.SchemaType, name, className) fun registerModel(path: String, className: ClassName) = register(ResolverKeyKind.Model, path, className) - fun registerCustomScalar(name: String, className: ClassName) = register(ResolverKeyKind.CustomScalarTarget, name, className) } fun ResolverClassName.toJavaPoetClassName(): ClassName = ClassName.get(packageName, simpleNames[0], *simpleNames.drop(1).toTypedArray()) diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/CustomScalarBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/CustomScalarBuilder.kt index b592419add6..e20eaebe2ae 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/CustomScalarBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/CustomScalarBuilder.kt @@ -16,13 +16,19 @@ class CustomScalarBuilder( ): JavaClassBuilder { private val layout = context.layout private val packageName = layout.typePackageName() - private val simpleName = layout.compiledTypeName(name = customScalar.name) + private val simpleName = prefixBuiltinScalarNames(layout.compiledTypeName(name = customScalar.name)) + + private fun prefixBuiltinScalarNames(name: String): String { + // Kotlin Multiplatform won't build with class names that clash with Kotlin types (String, Int, etc.). + // For consistency, do this for all built-in scalars, including ID, and in the Java codegen as well. + if (name in arrayOf("String", "Boolean", "Int", "Float", "ID")) { + return "GraphQL$name" + } + return name + } override fun prepare() { context.resolver.registerSchemaType(customScalar.name, ClassName.get(packageName, simpleName)) - if (customScalar.kotlinName != null) { - context.resolver.registerCustomScalar(customScalar.name, ClassName.bestGuess(customScalar.kotlinName)) - } } override fun build(): CodegenJavaFile { diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/SchemaBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/SchemaBuilder.kt index 5690367ce53..62051b62e4c 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/SchemaBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/SchemaBuilder.kt @@ -20,6 +20,7 @@ import javax.lang.model.element.Modifier class SchemaBuilder( private val context: JavaContext, + private val generatedSchemaName: String, private val objects: List, private val interfaces: List, private val unions: List, @@ -54,8 +55,8 @@ class SchemaBuilder( } private fun typeSpec(): TypeSpec { - return TypeSpec.classBuilder(layout.schemaName()) - .addJavadoc("A __Schema object containing all the composite types and a possibleTypes helper function") + return TypeSpec.classBuilder(generatedSchemaName) + .addJavadoc("A Schema object containing all the composite types and a possibleTypes helper function") .addModifiers(Modifier.PUBLIC) .addField(typesFieldSpec()) .addMethod(possibleTypesFunSpec()) @@ -71,4 +72,4 @@ class SchemaBuilder( builder.addStatement("return $T.possibleTypes($types, type)\n", JavaClassNames.PossibleTypes) return builder.build() } -} \ No newline at end of file +} diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/TypesBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/TypesBuilder.kt index 6487b3e6ebb..2cf154dad67 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/TypesBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/file/TypesBuilder.kt @@ -26,13 +26,22 @@ internal fun IrCustomScalar.typeFieldSpec(): FieldSpec { * so the fallback isn't really required here. We still write it as a way to hint the user * to what's happening behind the scenes */ - val kotlinName = kotlinName ?: "kotlin.Any" + val kotlinName = kotlinName ?: builtinScalarJavaName(name) ?: "java.lang.Object" return FieldSpec .builder(JavaClassNames.CustomScalarType, Identifier.type, Modifier.STATIC, Modifier.PUBLIC) .initializer("new $T($S, $S)", JavaClassNames.CustomScalarType, name, kotlinName) .build() } +private fun builtinScalarJavaName(name: String): String? = when (name) { + "Int" -> "java.lang.Integer" + "Float" -> "java.lang.Float" + "String" -> "java.lang.String" + "Boolean" -> "java.lang.Boolean" + "ID" -> "java.lang.String" + else -> null +} + internal fun IrEnum.typeFieldSpec(): FieldSpec { return FieldSpec .builder(JavaClassNames.EnumType, Identifier.type, Modifier.STATIC, Modifier.PUBLIC) @@ -91,4 +100,4 @@ internal fun IrUnion.typeFieldSpec(resolver: JavaResolver): FieldSpec { .maybeAddDeprecation(deprecationReason) .initializer("new $T($S, $L)", JavaClassNames.UnionType, name, builder.build()) .build() -} \ No newline at end of file +} diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinCodeGen.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinCodeGen.kt index 77f12fb8fbb..44f5c454cd2 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinCodeGen.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinCodeGen.kt @@ -2,6 +2,7 @@ package com.apollographql.apollo3.compiler.codegen.kotlin import com.apollographql.apollo3.compiler.APOLLO_VERSION import com.apollographql.apollo3.compiler.PackageNameGenerator +import com.apollographql.apollo3.compiler.ScalarInfo import com.apollographql.apollo3.compiler.TargetLanguage import com.apollographql.apollo3.compiler.codegen.ResolverInfo import com.apollographql.apollo3.compiler.codegen.kotlin.file.CustomScalarBuilder @@ -50,6 +51,7 @@ class KotlinCodeGen( private val generateFragmentImplementations: Boolean, private val generateQueryDocument: Boolean, private val generateSchema: Boolean, + private val generatedSchemaName: String, private val generateTestBuilders: Boolean, /** * Whether to flatten the models. This decision is left to the codegen. For fragments for an example, we @@ -59,6 +61,7 @@ class KotlinCodeGen( private val flatten: Boolean, private val sealedClassesForEnumsMatching: List, private val targetLanguageVersion: TargetLanguage, + private val scalarMapping: Map, ) { /** * @param outputDir: the directory where to write the Kotlin files @@ -66,7 +69,7 @@ class KotlinCodeGen( */ fun write(outputDir: File, testDir: File): ResolverInfo { val upstreamResolver = resolverInfos.fold(null as KotlinResolver?) { acc, resolverInfo -> - KotlinResolver(resolverInfo.entries, acc) + KotlinResolver(resolverInfo.entries, acc, scalarMapping) } val layout = KotlinCodegenLayout( @@ -78,7 +81,7 @@ class KotlinCodeGen( val context = KotlinContext( layout = layout, - resolver = KotlinResolver(emptyList(), upstreamResolver), + resolver = KotlinResolver(emptyList(), upstreamResolver, scalarMapping), targetLanguageVersion = targetLanguageVersion, ) val builders = mutableListOf() @@ -186,7 +189,7 @@ class KotlinCodeGen( } if (generateSchema) { - builders.add(SchemaBuilder(context, ir.objects, ir.interfaces, ir.unions)) + builders.add(SchemaBuilder(context, generatedSchemaName, ir.objects, ir.interfaces, ir.unions)) } builders.forEach { it.prepare() } diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinResolver.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinResolver.kt index f11546cfede..e8f85f20730 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinResolver.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinResolver.kt @@ -1,5 +1,8 @@ package com.apollographql.apollo3.compiler.codegen.kotlin +import com.apollographql.apollo3.compiler.ExpressionAdapterInitializer +import com.apollographql.apollo3.compiler.RuntimeAdapterInitializer +import com.apollographql.apollo3.compiler.ScalarInfo import com.apollographql.apollo3.compiler.codegen.Identifier.customScalarAdapters import com.apollographql.apollo3.compiler.codegen.Identifier.type import com.apollographql.apollo3.compiler.codegen.ResolverClassName @@ -23,7 +26,7 @@ import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy import com.squareup.kotlinpoet.TypeName -class KotlinResolver(entries: List, val next: KotlinResolver?) { +class KotlinResolver(entries: List, val next: KotlinResolver?, private val scalarMapping: Map) { fun resolve(key: ResolverKey): ClassName? = classNames[key] ?: next?.resolve(key) private var classNames = entries.associateBy( @@ -60,27 +63,42 @@ class KotlinResolver(entries: List, val next: KotlinResolver?) { type is IrNonNullType -> error("") // make the compiler happy, this case is handled as a fast path type is IrOptionalType -> KotlinSymbols.Optional.parameterizedBy(resolveIrType(type.ofType, override)) type is IrListType -> KotlinSymbols.List.parameterizedBy(resolveIrType(type.ofType, override)) - type is IrScalarType && type.name == "String" -> KotlinSymbols.String - type is IrScalarType && type.name == "Float" -> KotlinSymbols.Double - type is IrScalarType && type.name == "Int" -> KotlinSymbols.Int - type is IrScalarType && type.name == "Boolean" -> KotlinSymbols.Boolean - type is IrScalarType && type.name == "ID" -> KotlinSymbols.String - type is IrScalarType -> resolve(ResolverKeyKind.CustomScalarTarget, type.name) ?: KotlinSymbols.Any + type is IrScalarType -> resolveIrScalarType(type) type is IrModelType -> resolveAndAssert(ResolverKeyKind.Model, type.path) type is IrNamedType -> resolveAndAssert(ResolverKeyKind.SchemaType, type.name) else -> error("$type is not a schema type") }.copy(nullable = true) } + private fun resolveIrScalarType(type: IrScalarType): ClassName { + // Try mapping first, then built-ins, then fallback to Any + return resolveScalarTaget(type.name) ?: when (type.name) { + "String" -> KotlinSymbols.String + "Float" -> KotlinSymbols.Double + "Int" -> KotlinSymbols.Int + "Boolean" -> KotlinSymbols.Boolean + "ID" -> KotlinSymbols.String + else -> KotlinSymbols.Any + } + } + + fun resolveScalarTaget(name: String): ClassName? { + return scalarMapping.get(name)?.targetName?.let { + ClassName.bestGuess(it) + } + } + fun adapterInitializer(type: IrType, requiresBuffering: Boolean): CodeBlock { if (type !is IrNonNullType) { + // Don't hardcode the adapter when the scalar is mapped to a user-defined type + val scalarWithoutCustomMapping = type is IrScalarType && !scalarMapping.containsKey(type.name) return when { - type is IrScalarType && type.name == "ID" -> CodeBlock.of("%M", KotlinSymbols.NullableStringAdapter) - type is IrScalarType && type.name == "Boolean" -> CodeBlock.of("%M", KotlinSymbols.NullableBooleanAdapter) - type is IrScalarType && type.name == "String" -> CodeBlock.of("%M", KotlinSymbols.NullableStringAdapter) - type is IrScalarType && type.name == "Int" -> CodeBlock.of("%M", KotlinSymbols.NullableIntAdapter) - type is IrScalarType && type.name == "Float" -> CodeBlock.of("%M", KotlinSymbols.NullableDoubleAdapter) - type is IrScalarType && resolve(ResolverKeyKind.CustomScalarTarget, type.name) == null -> { + type is IrScalarType && type.name == "ID" && scalarWithoutCustomMapping -> CodeBlock.of("%M", KotlinSymbols.NullableStringAdapter) + type is IrScalarType && type.name == "Boolean" && scalarWithoutCustomMapping -> CodeBlock.of("%M", KotlinSymbols.NullableBooleanAdapter) + type is IrScalarType && type.name == "String" && scalarWithoutCustomMapping -> CodeBlock.of("%M", KotlinSymbols.NullableStringAdapter) + type is IrScalarType && type.name == "Int" && scalarWithoutCustomMapping -> CodeBlock.of("%M", KotlinSymbols.NullableIntAdapter) + type is IrScalarType && type.name == "Float" && scalarWithoutCustomMapping -> CodeBlock.of("%M", KotlinSymbols.NullableDoubleAdapter) + type is IrScalarType && resolveScalarTaget(type.name) == null -> { CodeBlock.of("%M", KotlinSymbols.NullableAnyAdapter) } else -> { @@ -94,11 +112,6 @@ class KotlinResolver(entries: List, val next: KotlinResolver?) { fun resolveCompiledType(name: String): CodeBlock { val builtin = when (name) { - "String" -> MemberName("com.apollographql.apollo3.api", "CompiledStringType") - "Int" -> MemberName("com.apollographql.apollo3.api", "CompiledIntType") - "Float" -> MemberName("com.apollographql.apollo3.api", "CompiledFloatType") - "Boolean" -> MemberName("com.apollographql.apollo3.api", "CompiledBooleanType") - "ID" -> MemberName("com.apollographql.apollo3.api", "CompiledIDType") "__Schema" -> MemberName("com.apollographql.apollo3.api", "CompiledSchemaType") "__Type" -> MemberName("com.apollographql.apollo3.api", "CompiledTypeType") "__Field" -> MemberName("com.apollographql.apollo3.api", "CompiledFieldType") @@ -122,22 +135,8 @@ class KotlinResolver(entries: List, val next: KotlinResolver?) { val listFun = MemberName("com.apollographql.apollo3.api", "list") CodeBlock.of("%L.%M()", adapterInitializer(type.ofType, requiresBuffering), listFun) } - type is IrScalarType && type.name == "Boolean" -> CodeBlock.of("%M", KotlinSymbols.BooleanAdapter) - type is IrScalarType && type.name == "ID" -> CodeBlock.of("%M", KotlinSymbols.StringAdapter) - type is IrScalarType && type.name == "String" -> CodeBlock.of("%M", KotlinSymbols.StringAdapter) - type is IrScalarType && type.name == "Int" -> CodeBlock.of("%M", KotlinSymbols.IntAdapter) - type is IrScalarType && type.name == "Float" -> CodeBlock.of("%M", KotlinSymbols.DoubleAdapter) type is IrScalarType -> { - val target = resolve(ResolverKeyKind.CustomScalarTarget, type.name) - if (target == null) { - CodeBlock.of("%M", KotlinSymbols.AnyAdapter) - } else { - CodeBlock.of( - "$customScalarAdapters.responseAdapterFor<%T>(%L)", - target, - resolveCompiledType(type.name) - ) - } + nonNullableScalarAdapterInitializer(type) } type is IrEnumType -> { CodeBlock.of("%T", resolveAndAssert(ResolverKeyKind.SchemaTypeAdapter, type.name)) @@ -156,6 +155,43 @@ class KotlinResolver(entries: List, val next: KotlinResolver?) { } } + private fun nonNullableScalarAdapterInitializer(type: IrScalarType): CodeBlock { + return when (val adapterInitializer = scalarMapping[type.name]?.adapterInitializer) { + is ExpressionAdapterInitializer -> { + CodeBlock.of(adapterInitializer.expression) + } + is RuntimeAdapterInitializer -> { + val target = resolveScalarTaget(type.name) + CodeBlock.of( + "$customScalarAdapters.responseAdapterFor<%T>(%L)", + target, + resolveCompiledType(type.name) + ) + } + else -> { + when (type.name) { + "Boolean" -> CodeBlock.of("%M", KotlinSymbols.BooleanAdapter) + "ID" -> CodeBlock.of("%M", KotlinSymbols.StringAdapter) + "String" -> CodeBlock.of("%M", KotlinSymbols.StringAdapter) + "Int" -> CodeBlock.of("%M", KotlinSymbols.IntAdapter) + "Float" -> CodeBlock.of("%M", KotlinSymbols.DoubleAdapter) + else -> { + val target = resolveScalarTaget(type.name) + if (target == null) { + CodeBlock.of("%M", KotlinSymbols.AnyAdapter) + } else { + CodeBlock.of( + "$customScalarAdapters.responseAdapterFor<%T>(%L)", + target, + resolveCompiledType(type.name) + ) + } + } + } + } + } + } + fun resolveModel(path: String) = resolveAndAssert(ResolverKeyKind.Model, path) fun registerModelAdapter(path: String, className: ClassName) = register(ResolverKeyKind.ModelAdapter, path, className) @@ -198,9 +234,7 @@ class KotlinResolver(entries: List, val next: KotlinResolver?) { fun resolveSchemaType(name: String) = resolveAndAssert(ResolverKeyKind.SchemaType, name) fun registerSchemaType(name: String, className: ClassName) = register(ResolverKeyKind.SchemaType, name, className) fun registerModel(path: String, className: ClassName) = register(ResolverKeyKind.Model, path, className) - fun registerCustomScalar(name: String, className: ClassName) = register(ResolverKeyKind.CustomScalarTarget, name, className) - fun registerTestBuilder(path: String, className: ClassName) = register(ResolverKeyKind.TestBuilder, path, className) fun resolveTestBuilder(path: String) = resolveAndAssert(ResolverKeyKind.TestBuilder, path) -} \ No newline at end of file +} diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/CustomScalarBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/CustomScalarBuilder.kt index 007d3812114..0fc2c365d93 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/CustomScalarBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/CustomScalarBuilder.kt @@ -1,7 +1,6 @@ package com.apollographql.apollo3.compiler.codegen.kotlin.file import com.apollographql.apollo3.compiler.codegen.kotlin.CgFile -import com.apollographql.apollo3.compiler.codegen.kotlin.CgFileBuilder import com.apollographql.apollo3.compiler.codegen.kotlin.CgOutputFileBuilder import com.apollographql.apollo3.compiler.codegen.kotlin.KotlinContext import com.apollographql.apollo3.compiler.codegen.kotlin.helpers.maybeAddDeprecation @@ -12,17 +11,23 @@ import com.squareup.kotlinpoet.TypeSpec class CustomScalarBuilder( private val context: KotlinContext, - private val customScalar: IrCustomScalar -): CgOutputFileBuilder { + private val customScalar: IrCustomScalar, +) : CgOutputFileBuilder { private val layout = context.layout private val packageName = layout.typePackageName() - private val simpleName = layout.compiledTypeName(name = customScalar.name) + private val simpleName = prefixBuiltinScalarNames(layout.compiledTypeName(name = customScalar.name)) + + private fun prefixBuiltinScalarNames(name: String): String { + // Kotlin Multiplatform won't build with class names that clash with Kotlin types (String, Int, etc.). + // For consistency, do this for all built-in scalars, including ID. + if (name in arrayOf("String", "Boolean", "Int", "Float", "ID")) { + return "GraphQL$name" + } + return name + } override fun prepare() { context.resolver.registerSchemaType(customScalar.name, ClassName(packageName, simpleName)) - if (customScalar.kotlinName != null) { - context.resolver.registerCustomScalar(customScalar.name, ClassName.bestGuess(customScalar.kotlinName)) - } } override fun build(): CgFile { diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/SchemaBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/SchemaBuilder.kt index 7476d0943e3..cf2ef3861d8 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/SchemaBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/SchemaBuilder.kt @@ -17,6 +17,7 @@ import com.squareup.kotlinpoet.TypeSpec class SchemaBuilder( private val context: KotlinContext, + private val generatedSchemaName: String, private val objects: List, private val interfaces: List, private val unions: List, @@ -30,7 +31,7 @@ class SchemaBuilder( override fun build(): CgFile { return CgFile( packageName = packageName, - fileName = layout.schemaName(), + fileName = generatedSchemaName, typeSpecs = listOf(typeSpec()) ) } @@ -54,8 +55,8 @@ class SchemaBuilder( } private fun typeSpec(): TypeSpec { - return TypeSpec.objectBuilder(layout.schemaName()) - .addKdoc("A __Schema object containing all the composite types and a possibleTypes helper function") + return TypeSpec.objectBuilder(generatedSchemaName) + .addKdoc("A ___Schema object containing all the composite types and a possibleTypes helper function") .addProperty(typesPropertySpec()) .addFunction(possibleTypesFunSpec()) .build() @@ -69,4 +70,4 @@ class SchemaBuilder( builder.addCode("return %M(all, type)\n", MemberName("com.apollographql.apollo3.api", "possibleTypes")) return builder.build() } -} \ No newline at end of file +} diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/TypesBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/TypesBuilder.kt index 0c832ee2243..ac3311fea45 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/TypesBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/file/TypesBuilder.kt @@ -21,13 +21,22 @@ internal fun IrCustomScalar.typePropertySpec(): PropertySpec { * so the fallback isn't really required here. We still write it as a way to hint the user * to what's happening behind the scenes */ - val kotlinName = kotlinName ?: "kotlin.Any" + val kotlinName = kotlinName ?: builtinScalarKotlinName(name) ?: "kotlin.Any" return PropertySpec .builder(Identifier.type, KotlinSymbols.CustomScalarType) .initializer("%T(%S, %S)", KotlinSymbols.CustomScalarType, name, kotlinName) .build() } +private fun builtinScalarKotlinName(name: String): String? = when (name) { + "Int" -> "kotlin.Int" + "Float" -> "kotlin.Float" + "String" -> "kotlin.String" + "Boolean" -> "kotlin.Boolean" + "ID" -> "kotlin.String" + else -> null +} + internal fun IrEnum.typePropertySpec(): PropertySpec { return PropertySpec .builder(Identifier.type, KotlinSymbols.EnumType) @@ -104,4 +113,4 @@ internal fun IrUnion.typePropertySpec(resolver: KotlinResolver): PropertySpec { .maybeAddDeprecation(deprecationReason) .initializer("%T(%S, %L)", KotlinSymbols.UnionType, name, builder.build()) .build() -} \ No newline at end of file +} diff --git a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ir/IrBuilder.kt b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ir/IrBuilder.kt index 21a43ad57b6..ea12288e9cd 100644 --- a/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ir/IrBuilder.kt +++ b/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/ir/IrBuilder.kt @@ -53,6 +53,7 @@ import com.apollographql.apollo3.ast.transform import com.apollographql.apollo3.compiler.MODELS_COMPAT import com.apollographql.apollo3.compiler.MODELS_OPERATION_BASED import com.apollographql.apollo3.compiler.MODELS_RESPONSE_BASED +import com.apollographql.apollo3.compiler.ScalarInfo @OptIn(ApolloExperimental::class) internal class IrBuilder( @@ -62,7 +63,7 @@ internal class IrBuilder( private val fragmentDefinitions: List, private val allFragmentDefinitions: Map, private val alwaysGenerateTypesMatching: Set, - private val customScalarsMapping: Map, + private val scalarMapping: Map, private val codegenModels: String, private val generateOptionalOperationVariables: Boolean, ) : FieldMerger { @@ -105,10 +106,18 @@ internal class IrBuilder( val unions = mutableListOf() val customScalars = mutableListOf() - // inject extra types + // Inject extra types usedTypes.addAll(schema.typeDefinitions.keys.filter { shouldAlwaysGenerate(it) }) - // inject custom scalars specified in the Gradle configuration - usedTypes.addAll(customScalarsMapping.keys) + + // Inject all built-in scalars + usedTypes.add("String") + usedTypes.add("Boolean") + usedTypes.add("Int") + usedTypes.add("Float") + usedTypes.add("ID") + + // Inject custom scalars specified in the Gradle configuration + usedTypes.addAll(scalarMapping.keys) // Generate the root types operationDefinitions.forEach { @@ -131,8 +140,8 @@ internal class IrBuilder( } visitedTypes.add(name) val typeDefinition = schema.typeDefinition(name) - if (typeDefinition.isBuiltIn()) { - // We don't generate builtin types + if (typeDefinition.isBuiltIn() && typeDefinition !is GQLScalarTypeDefinition) { + // We don't generate builtin types, except scalars continue } @@ -201,7 +210,7 @@ internal class IrBuilder( private fun GQLScalarTypeDefinition.toIr(): IrCustomScalar { return IrCustomScalar( name = name, - kotlinName = customScalarsMapping[name], + kotlinName = scalarMapping[name]?.targetName, description = description, deprecationReason = directives.findDeprecationReason() ) diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/Date.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/Date.java.expected index a70e5ad51cd..352b418c3b6 100644 --- a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/Date.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/Date.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * The `Date` scalar type represents date format. */ public class Date { - public static CustomScalarType type = new CustomScalarType("Date", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("Date", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..704484c0a6e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..c9a6c190e16 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLID.java.expected new file mode 100644 index 00000000000..54d357d5269 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..2b1596622df --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLString.java.expected new file mode 100644 index 00000000000..8954ff40add --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/URL.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/URL.java.expected index 56c21d5f167..d76e09fb7ee 100644 --- a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/URL.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/URL.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * URL for testing */ public class URL { - public static CustomScalarType type = new CustomScalarType("URL", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("URL", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/UnsupportedType.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/UnsupportedType.java.expected index 966e553b9a9..6be0006940e 100644 --- a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/UnsupportedType.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/UnsupportedType.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * UnsupportedType for testing */ public class UnsupportedType { - public static CustomScalarType type = new CustomScalarType("UnsupportedType", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("UnsupportedType", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/__Schema.java.expected b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/__Schema.java.expected index 1c6e94e9e11..bdf5d0ad0ba 100644 --- a/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/__Schema.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/__schema/java/operationBased/__schema/type/__Schema.java.expected @@ -13,7 +13,7 @@ import java.util.Arrays; import java.util.List; /** - * A __Schema object containing all the composite types and a possibleTypes helper function + * A Schema object containing all the composite types and a possibleTypes helper function */ public class __Schema { public static List types = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4304d9a5a22 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..f15d1f44017 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..5205ddb77fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..848c82d4619 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..777ce5f82ab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.__schema.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/__Schema.kt.expected b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/__Schema.kt.expected index 04c14cc658c..2dd21b37b8a 100644 --- a/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/__Schema.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/__schema/kotlin/responseBased/__schema/type/__Schema.kt.expected @@ -11,7 +11,7 @@ import com.apollographql.apollo3.api.ObjectType import kotlin.collections.List /** - * A __Schema object containing all the composite types and a possibleTypes helper function + * A ___Schema object containing all the composite types and a possibleTypes helper function */ public object __Schema { public val all: List = listOf( diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/selections/TestQuerySelections.java.expected index 8df4e5d20c8..068c6e5f6eb 100644 --- a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/selections/TestQuerySelections.java.expected @@ -7,18 +7,18 @@ package com.example.antlr_tokens.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.antlr_tokens.type.GraphQLString; import com.example.antlr_tokens.type.TypeWithGraphQLKeywords; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List typeWithGraphQLKeywords = Arrays.asList( - new CompiledField.Builder("on", CompiledGraphQL.CompiledStringType).build(), - new CompiledField.Builder("null", CompiledGraphQL.CompiledStringType).arguments(Arrays.asList(new CompiledArgument("fragment", new CompiledVariable("operation"), false))).build(), - new CompiledField.Builder("null", CompiledGraphQL.CompiledStringType).alias("alias").arguments(Arrays.asList(new CompiledArgument("fragment", "A string\n" + new CompiledField.Builder("on", GraphQLString.type).build(), + new CompiledField.Builder("null", GraphQLString.type).arguments(Arrays.asList(new CompiledArgument("fragment", new CompiledVariable("operation"), false))).build(), + new CompiledField.Builder("null", GraphQLString.type).alias("alias").arguments(Arrays.asList(new CompiledArgument("fragment", "A string\n" + "with a new line", false))).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..990f3c8a931 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..031f9087939 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLID.java.expected new file mode 100644 index 00000000000..61f1869f07a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..54b087dcbe6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLString.java.expected new file mode 100644 index 00000000000..445c7ba7d0a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/java/operationBased/antlr_tokens/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/selections/TestQuerySelections.kt.expected index 1b3d2ae421a..60226a7e5de 100644 --- a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/selections/TestQuerySelections.kt.expected @@ -8,8 +8,8 @@ package com.example.antlr_tokens.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable +import com.example.antlr_tokens.type.GraphQLString import com.example.antlr_tokens.type.TypeWithGraphQLKeywords import kotlin.collections.List @@ -17,18 +17,18 @@ public object TestQuerySelections { private val typeWithGraphQLKeywords: List = listOf( CompiledField.Builder( name = "on", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "null", - type = CompiledStringType + type = GraphQLString.type ).arguments(listOf( CompiledArgument("fragment", CompiledVariable("operation")) )) .build(), CompiledField.Builder( name = "null", - type = CompiledStringType + type = GraphQLString.type ).alias("alias") .arguments(listOf( CompiledArgument("fragment", """ diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..05cbb342f62 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..0cba2c74761 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..caf2d1c9d76 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..3efc9e344a1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..e1271a3c4fb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/antlr_tokens/kotlin/responseBased/antlr_tokens/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.antlr_tokens.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/selections/TestQuerySelections.java.expected index f9743eb7fbe..11b0759ce0b 100644 --- a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/selections/TestQuerySelections.java.expected @@ -7,22 +7,23 @@ package com.example.arguments_hardcoded.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.arguments_hardcoded.type.GraphQLInt; +import com.example.arguments_hardcoded.type.GraphQLString; import com.example.arguments_hardcoded.type.Review; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List reviews = Arrays.asList( - new CompiledField.Builder("stars", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).build(), - new CompiledField.Builder("commentary", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("stars", new CompiledNotNullType(GraphQLInt.type)).build(), + new CompiledField.Builder("commentary", GraphQLString.type).build() ); public static List root = Arrays.asList( new CompiledField.Builder("reviews", new CompiledListType(Review.type)).arguments(Arrays.asList(new CompiledArgument("episode", "JEDI", false), new CompiledArgument("starsFloat", 9.9, false), new CompiledArgument("starsInt", 10, false))).selections(reviews).build(), - new CompiledField.Builder("testNullableArguments", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).arguments(Arrays.asList(new CompiledArgument("boolean", null, false), new CompiledArgument("episode", null, false), new CompiledArgument("float", null, false), new CompiledArgument("int", null, false), new CompiledArgument("list", null, false), new CompiledArgument("review", null, false), new CompiledArgument("string", null, false))).build() + new CompiledField.Builder("testNullableArguments", new CompiledNotNullType(GraphQLInt.type)).arguments(Arrays.asList(new CompiledArgument("boolean", null, false), new CompiledArgument("episode", null, false), new CompiledArgument("float", null, false), new CompiledArgument("int", null, false), new CompiledArgument("list", null, false), new CompiledArgument("review", null, false), new CompiledArgument("string", null, false))).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..d3e27574fae --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..86e4101c2e8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLID.java.expected new file mode 100644 index 00000000000..290b20a9626 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..d418e6bd7cb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLString.java.expected new file mode 100644 index 00000000000..aeaf9af28b5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/java/operationBased/arguments_hardcoded/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/selections/TestQuerySelections.kt.expected index 5a7a519a15d..880839b3251 100644 --- a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/selections/TestQuerySelections.kt.expected @@ -7,11 +7,11 @@ package com.example.arguments_hardcoded.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.arguments_hardcoded.type.GraphQLInt +import com.example.arguments_hardcoded.type.GraphQLString import com.example.arguments_hardcoded.type.Review import kotlin.collections.List @@ -19,11 +19,11 @@ public object TestQuerySelections { private val reviews: List = listOf( CompiledField.Builder( name = "stars", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).build(), CompiledField.Builder( name = "commentary", - type = CompiledStringType + type = GraphQLString.type ).build() ) @@ -40,7 +40,7 @@ public object TestQuerySelections { .build(), CompiledField.Builder( name = "testNullableArguments", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).arguments(listOf( CompiledArgument("boolean", null), CompiledArgument("episode", null), diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..092b8646de6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d47086ce869 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..1576f5d40db --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..0385dad11b9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3283dabe2cc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/arguments_hardcoded/kotlin/responseBased/arguments_hardcoded/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.arguments_hardcoded.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..2cbe22068e7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..9a4f3ce1dbc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLID.java.expected new file mode 100644 index 00000000000..d5cf9729549 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..ddbde17bb36 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLString.java.expected new file mode 100644 index 00000000000..acfe7b43531 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/java/operationBased/case_sensitive_enum/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..7ff3fb671cb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ff53764a706 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..e5954f8de93 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2093bf7448a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..528f490e80d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/case_sensitive_enum/kotlin/responseBased/case_sensitive_enum/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.case_sensitive_enum.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/TestOperation.graphql b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/TestOperation.graphql index f4fa0874da2..8d1cdb11ce9 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/TestOperation.graphql +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/TestOperation.graphql @@ -1,6 +1,7 @@ # multiple scalar fields query TestQuery { hero { + id name birthDate appearanceDates diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/TestQuery.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/TestQuery.java.expected index 0c5ed830325..69917f093fe 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/TestQuery.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/TestQuery.java.expected @@ -14,6 +14,7 @@ import com.apollographql.apollo3.api.json.JsonWriter; import com.example.custom_scalar_type.adapter.TestQuery_ResponseAdapter; import com.example.custom_scalar_type.selections.TestQuerySelections; import java.io.IOException; +import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; @@ -21,7 +22,7 @@ import java.util.Date; import java.util.List; public class TestQuery implements Query { - public static final String OPERATION_ID = "8f6fd98f3592845e0a3eb760b37ff5bcdad7edc2cbbdfd8350af519bd3a26b19"; + public static final String OPERATION_ID = "1d5498a23394700442413af8ec1b8edce1445ce533afdb2e9d5ec9c0ed40a9e3"; /** * The minimized GraphQL document being sent to the server to save a few bytes. @@ -29,6 +30,7 @@ public class TestQuery implements Query { * * query TestQuery { * hero { + * id * name * birthDate * appearanceDates @@ -38,7 +40,7 @@ public class TestQuery implements Query { * } * } */ - public static final String OPERATION_DOCUMENT = "query TestQuery { hero { name birthDate appearanceDates fieldWithUnsupportedType profileLink links } }"; + public static final String OPERATION_DOCUMENT = "query TestQuery { hero { id name birthDate appearanceDates fieldWithUnsupportedType profileLink links } }"; public static final String OPERATION_NAME = "TestQuery"; @@ -167,6 +169,11 @@ public class TestQuery implements Query { } public static class Hero { + /** + * The ID of the character + */ + public Long id; + /** * The name of the character */ @@ -203,8 +210,9 @@ public class TestQuery implements Query { private transient volatile String $toString; - public Hero(String name, Date birthDate, List appearanceDates, + public Hero(Long id, String name, Date birthDate, List appearanceDates, Object fieldWithUnsupportedType, String profileLink, List links) { + this.id = id; this.name = name; this.birthDate = birthDate; this.appearanceDates = appearanceDates; @@ -220,7 +228,8 @@ public class TestQuery implements Query { } if (o instanceof Hero) { Hero that = (Hero) o; - return ((this.name == null) ? (that.name == null) : this.name.equals(that.name)) + return ((this.id == null) ? (that.id == null) : this.id.equals(that.id)) + &&((this.name == null) ? (that.name == null) : this.name.equals(that.name)) &&((this.birthDate == null) ? (that.birthDate == null) : this.birthDate.equals(that.birthDate)) &&((this.appearanceDates == null) ? (that.appearanceDates == null) : this.appearanceDates.equals(that.appearanceDates)) &&((this.fieldWithUnsupportedType == null) ? (that.fieldWithUnsupportedType == null) : this.fieldWithUnsupportedType.equals(that.fieldWithUnsupportedType)) @@ -235,6 +244,8 @@ public class TestQuery implements Query { if (!$hashCodeMemoized) { int h = 1; h *= 1000003; + h ^= (id == null) ? 0 : id.hashCode(); + h *= 1000003; h ^= (name == null) ? 0 : name.hashCode(); h *= 1000003; h ^= (birthDate == null) ? 0 : birthDate.hashCode(); @@ -256,6 +267,7 @@ public class TestQuery implements Query { public String toString() { if ($toString == null) { $toString = "Hero{" + + "id=" + id + ", " + "name=" + name + ", " + "birthDate=" + birthDate + ", " + "appearanceDates=" + appearanceDates + ", " diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.java.expected index e7ad217324d..255061edb9a 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.java.expected @@ -15,8 +15,9 @@ import com.apollographql.apollo3.api.ObjectAdapter; import com.apollographql.apollo3.api.json.JsonReader; import com.apollographql.apollo3.api.json.JsonWriter; import com.example.custom_scalar_type.TestQuery; -import com.example.custom_scalar_type.type.URL; +import com.example.custom_scalar_type.type.GraphQLID; import java.io.IOException; +import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; @@ -59,11 +60,12 @@ public class TestQuery_ResponseAdapter { public enum Hero implements Adapter { INSTANCE; - private static final List RESPONSE_NAMES = Arrays.asList("name", "birthDate", "appearanceDates", "fieldWithUnsupportedType", "profileLink", "links"); + private static final List RESPONSE_NAMES = Arrays.asList("id", "name", "birthDate", "appearanceDates", "fieldWithUnsupportedType", "profileLink", "links"); @Override public TestQuery.Hero fromJson(JsonReader reader, CustomScalarAdapters customScalarAdapters) throws IOException { + Long id = null; String name = null; Date birthDate = null; List appearanceDates = null; @@ -74,16 +76,18 @@ public class TestQuery_ResponseAdapter { loop: while(true) { switch (reader.selectName(RESPONSE_NAMES)) { - case 0: name = Adapters.StringAdapter.fromJson(reader, customScalarAdapters); break; - case 1: birthDate = (customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type)).fromJson(reader, customScalarAdapters); break; - case 2: appearanceDates = new ListAdapter<>((customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type))).fromJson(reader, customScalarAdapters); break; - case 3: fieldWithUnsupportedType = Adapters.AnyAdapter.fromJson(reader, customScalarAdapters); break; - case 4: profileLink = (customScalarAdapters.responseAdapterFor(URL.type)).fromJson(reader, customScalarAdapters); break; - case 5: links = new ListAdapter<>((customScalarAdapters.responseAdapterFor(URL.type))).fromJson(reader, customScalarAdapters); break; + case 0: id = (customScalarAdapters.responseAdapterFor(GraphQLID.type)).fromJson(reader, customScalarAdapters); break; + case 1: name = new com.example.MyStringAdapter().fromJson(reader, customScalarAdapters); break; + case 2: birthDate = (customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type)).fromJson(reader, customScalarAdapters); break; + case 3: appearanceDates = new ListAdapter<>((customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type))).fromJson(reader, customScalarAdapters); break; + case 4: fieldWithUnsupportedType = Adapters.AnyAdapter.fromJson(reader, customScalarAdapters); break; + case 5: profileLink = com.example.UrlAdapter.INSTANCE.fromJson(reader, customScalarAdapters); break; + case 6: links = new ListAdapter<>(com.example.UrlAdapter.INSTANCE).fromJson(reader, customScalarAdapters); break; default: break loop; } } + Assertions.checkFieldNotMissing(id, "id"); Assertions.checkFieldNotMissing(name, "name"); Assertions.checkFieldNotMissing(birthDate, "birthDate"); Assertions.checkFieldNotMissing(appearanceDates, "appearanceDates"); @@ -92,6 +96,7 @@ public class TestQuery_ResponseAdapter { Assertions.checkFieldNotMissing(links, "links"); return new TestQuery.Hero( + id, name, birthDate, appearanceDates, @@ -104,8 +109,11 @@ public class TestQuery_ResponseAdapter { @Override public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters, TestQuery.Hero value) throws IOException { + writer.name("id"); + (customScalarAdapters.responseAdapterFor(GraphQLID.type)).toJson(writer, customScalarAdapters, value.id); + writer.name("name"); - Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.name); + new com.example.MyStringAdapter().toJson(writer, customScalarAdapters, value.name); writer.name("birthDate"); (customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type)).toJson(writer, customScalarAdapters, value.birthDate); @@ -117,10 +125,10 @@ public class TestQuery_ResponseAdapter { Adapters.AnyAdapter.toJson(writer, customScalarAdapters, value.fieldWithUnsupportedType); writer.name("profileLink"); - (customScalarAdapters.responseAdapterFor(URL.type)).toJson(writer, customScalarAdapters, value.profileLink); + com.example.UrlAdapter.INSTANCE.toJson(writer, customScalarAdapters, value.profileLink); writer.name("links"); - new ListAdapter<>((customScalarAdapters.responseAdapterFor(URL.type))).toJson(writer, customScalarAdapters, value.links); + new ListAdapter<>(com.example.UrlAdapter.INSTANCE).toJson(writer, customScalarAdapters, value.links); } } } diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/selections/TestQuerySelections.java.expected index 51d9d227981..3cb4492ab67 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/selections/TestQuerySelections.java.expected @@ -6,12 +6,13 @@ package com.example.custom_scalar_type.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.custom_scalar_type.type.Character; import com.example.custom_scalar_type.type.Date; +import com.example.custom_scalar_type.type.GraphQLID; +import com.example.custom_scalar_type.type.GraphQLString; import com.example.custom_scalar_type.type.URL; import com.example.custom_scalar_type.type.UnsupportedType; import java.util.Arrays; @@ -19,7 +20,8 @@ import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("birthDate", new CompiledNotNullType(Date.type)).build(), new CompiledField.Builder("appearanceDates", new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Date.type)))).build(), new CompiledField.Builder("fieldWithUnsupportedType", new CompiledNotNullType(UnsupportedType.type)).build(), diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..8916adb742f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..61a71289e60 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLID.java.expected new file mode 100644 index 00000000000..8d7a64dc834 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.Long"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..eaa7c67ab9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLString.java.expected new file mode 100644 index 00000000000..c59e71c6bd6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/UnsupportedType.java.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/UnsupportedType.java.expected index e0cab28c72e..f7ced3ab8fb 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/UnsupportedType.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/java/operationBased/custom_scalar_type/type/UnsupportedType.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * UnsupportedType for testing */ public class UnsupportedType { - public static CustomScalarType type = new CustomScalarType("UnsupportedType", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("UnsupportedType", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/TestQuery.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/TestQuery.kt.expected index 86720ec3270..ff679859def 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/TestQuery.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/TestQuery.kt.expected @@ -13,6 +13,7 @@ import com.apollographql.apollo3.api.json.JsonWriter import com.apollographql.apollo3.api.obj import com.example.custom_scalar_type.adapter.TestQuery_ResponseAdapter import com.example.custom_scalar_type.selections.TestQuerySelections +import java.lang.Long import java.util.Date import kotlin.Any import kotlin.String @@ -46,10 +47,14 @@ public class TestQuery() : Query { public val hero: Hero? ) : Query.Data { public data class Hero( + /** + * The ID of the character + */ + public val id: Long, /** * The name of the character */ - public val name: String, + public val name: java.lang.String, /** * The date character was born. */ @@ -75,7 +80,7 @@ public class TestQuery() : Query { public companion object { public const val OPERATION_ID: String = - "8f6fd98f3592845e0a3eb760b37ff5bcdad7edc2cbbdfd8350af519bd3a26b19" + "1d5498a23394700442413af8ec1b8edce1445ce533afdb2e9d5ec9c0ed40a9e3" /** * The minimized GraphQL document being sent to the server to save a few bytes. @@ -83,6 +88,7 @@ public class TestQuery() : Query { * * query TestQuery { * hero { + * id * name * birthDate * appearanceDates @@ -93,7 +99,7 @@ public class TestQuery() : Query { * } */ public const val OPERATION_DOCUMENT: String = - "query TestQuery { hero { name birthDate appearanceDates fieldWithUnsupportedType profileLink links } }" + "query TestQuery { hero { id name birthDate appearanceDates fieldWithUnsupportedType profileLink links } }" public const val OPERATION_NAME: String = "TestQuery" } diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.kt.expected index c9669f96650..9121440db50 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/adapter/TestQuery_ResponseAdapter.kt.expected @@ -8,14 +8,14 @@ package com.example.custom_scalar_type.adapter import com.apollographql.apollo3.api.Adapter import com.apollographql.apollo3.api.AnyAdapter import com.apollographql.apollo3.api.CustomScalarAdapters -import com.apollographql.apollo3.api.StringAdapter import com.apollographql.apollo3.api.json.JsonReader import com.apollographql.apollo3.api.json.JsonWriter import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.nullable import com.apollographql.apollo3.api.obj import com.example.custom_scalar_type.TestQuery -import com.example.custom_scalar_type.type.URL +import com.example.custom_scalar_type.type.GraphQLID +import java.lang.Long import java.util.Date import kotlin.Any import kotlin.String @@ -52,12 +52,13 @@ public object TestQuery_ResponseAdapter { } private object Hero : Adapter { - public val RESPONSE_NAMES: List = listOf("name", "birthDate", "appearanceDates", + public val RESPONSE_NAMES: List = listOf("id", "name", "birthDate", "appearanceDates", "fieldWithUnsupportedType", "profileLink", "links") public override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): TestQuery.Data.Hero { - var name: String? = null + var id: Long? = null + var name: java.lang.String? = null var birthDate: Date? = null var appearanceDates: List? = null var fieldWithUnsupportedType: Any? = null @@ -66,21 +67,22 @@ public object TestQuery_ResponseAdapter { while(true) { when (reader.selectName(RESPONSE_NAMES)) { - 0 -> name = StringAdapter.fromJson(reader, customScalarAdapters) - 1 -> birthDate = customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type).fromJson(reader, + 0 -> id = customScalarAdapters.responseAdapterFor(GraphQLID.type).fromJson(reader, customScalarAdapters) - 2 -> appearanceDates = customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type).list().fromJson(reader, + 1 -> name = com.example.MyStringAdapter().fromJson(reader, customScalarAdapters) + 2 -> birthDate = customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type).fromJson(reader, customScalarAdapters) - 3 -> fieldWithUnsupportedType = AnyAdapter.fromJson(reader, customScalarAdapters) - 4 -> profileLink = customScalarAdapters.responseAdapterFor(URL.type).fromJson(reader, - customScalarAdapters) - 5 -> links = customScalarAdapters.responseAdapterFor(URL.type).list().fromJson(reader, + 3 -> appearanceDates = customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type).list().fromJson(reader, customScalarAdapters) + 4 -> fieldWithUnsupportedType = AnyAdapter.fromJson(reader, customScalarAdapters) + 5 -> profileLink = com.example.UrlAdapter.fromJson(reader, customScalarAdapters) + 6 -> links = com.example.UrlAdapter.list().fromJson(reader, customScalarAdapters) else -> break } } return TestQuery.Data.Hero( + id = id!!, name = name!!, birthDate = birthDate!!, appearanceDates = appearanceDates!!, @@ -95,8 +97,12 @@ public object TestQuery_ResponseAdapter { customScalarAdapters: CustomScalarAdapters, `value`: TestQuery.Data.Hero ): Unit { + writer.name("id") + customScalarAdapters.responseAdapterFor(GraphQLID.type).toJson(writer, + customScalarAdapters, value.id) + writer.name("name") - StringAdapter.toJson(writer, customScalarAdapters, value.name) + com.example.MyStringAdapter().toJson(writer, customScalarAdapters, value.name) writer.name("birthDate") customScalarAdapters.responseAdapterFor(com.example.custom_scalar_type.type.Date.type).toJson(writer, @@ -110,12 +116,10 @@ public object TestQuery_ResponseAdapter { AnyAdapter.toJson(writer, customScalarAdapters, value.fieldWithUnsupportedType) writer.name("profileLink") - customScalarAdapters.responseAdapterFor(URL.type).toJson(writer, - customScalarAdapters, value.profileLink) + com.example.UrlAdapter.toJson(writer, customScalarAdapters, value.profileLink) writer.name("links") - customScalarAdapters.responseAdapterFor(URL.type).list().toJson(writer, - customScalarAdapters, value.links) + com.example.UrlAdapter.list().toJson(writer, customScalarAdapters, value.links) } } } diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/selections/TestQuerySelections.kt.expected index c0653f7e189..2391ca45bdc 100644 --- a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/selections/TestQuerySelections.kt.expected @@ -7,20 +7,25 @@ package com.example.custom_scalar_type.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.custom_scalar_type.type.Character import com.example.custom_scalar_type.type.Date +import com.example.custom_scalar_type.type.GraphQLID +import com.example.custom_scalar_type.type.GraphQLString import com.example.custom_scalar_type.type.URL import com.example.custom_scalar_type.type.UnsupportedType import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( + CompiledField.Builder( + name = "id", + type = GraphQLID.type.notNull() + ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4bd2b64e6dc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a5206689e41 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..0acee250f4b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "java.lang.Long") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..36b63bd3c86 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..44970080373 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/custom_scalar_type/kotlin/responseBased/custom_scalar_type/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.custom_scalar_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "java.lang.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.java.expected index 9f8486631e3..96607e20566 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.java.expected @@ -7,23 +7,23 @@ package com.example.deprecated_merged_field.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.deprecated_merged_field.type.GraphQLString; import java.util.Arrays; import java.util.List; public class AnimalFragmentSelections { private static List onCat = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List onDog = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Cat", Arrays.asList("Cat")).selections(onCat).build(), new CompiledFragment.Builder("Dog", Arrays.asList("Dog")).selections(onDog).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/selections/CatQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/selections/CatQuerySelections.java.expected index 535eabd4ba9..204bdc81eb0 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/selections/CatQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/selections/CatQuerySelections.java.expected @@ -7,17 +7,17 @@ package com.example.deprecated_merged_field.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.deprecated_merged_field.fragment.selections.AnimalFragmentSelections; import com.example.deprecated_merged_field.type.Cat; +import com.example.deprecated_merged_field.type.GraphQLString; import java.util.Arrays; import java.util.List; public class CatQuerySelections { private static List cat = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Animal", Arrays.asList("Cat", "Dog")).selections(AnimalFragmentSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..4e102b3e644 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..d42a5881fd1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLID.java.expected new file mode 100644 index 00000000000..4eef06765d9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..82f4beaf1fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLString.java.expected new file mode 100644 index 00000000000..6d977315df6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/java/operationBased/deprecated_merged_field/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected index b1138989012..a0a67f64aa6 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected @@ -8,29 +8,29 @@ package com.example.deprecated_merged_field.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.deprecated_merged_field.type.GraphQLString import kotlin.collections.List public object AnimalFragmentSelections { private val onCat: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onDog: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Cat", diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/selections/CatQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/selections/CatQuerySelections.kt.expected index 37674b8c4ca..afc65ef6cd7 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/selections/CatQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/selections/CatQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.deprecated_merged_field.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.deprecated_merged_field.fragment.selections.AnimalFragmentSelections import com.example.deprecated_merged_field.type.Cat +import com.example.deprecated_merged_field.type.GraphQLString import kotlin.collections.List public object CatQuerySelections { private val cat: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Animal", diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4509f504abe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..43dd61411f8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..83e0457be7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..7383c025997 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..1b78b642978 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/compat/deprecated_merged_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected index b1138989012..a0a67f64aa6 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected @@ -8,29 +8,29 @@ package com.example.deprecated_merged_field.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.deprecated_merged_field.type.GraphQLString import kotlin.collections.List public object AnimalFragmentSelections { private val onCat: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onDog: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Cat", diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected index 37674b8c4ca..afc65ef6cd7 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.deprecated_merged_field.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.deprecated_merged_field.fragment.selections.AnimalFragmentSelections import com.example.deprecated_merged_field.type.Cat +import com.example.deprecated_merged_field.type.GraphQLString import kotlin.collections.List public object CatQuerySelections { private val cat: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Animal", diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4509f504abe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..43dd61411f8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..83e0457be7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..7383c025997 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..1b78b642978 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/operationBased/deprecated_merged_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected index b1138989012..a0a67f64aa6 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/fragment/selections/AnimalFragmentSelections.kt.expected @@ -8,29 +8,29 @@ package com.example.deprecated_merged_field.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.deprecated_merged_field.type.GraphQLString import kotlin.collections.List public object AnimalFragmentSelections { private val onCat: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onDog: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Cat", diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected index 37674b8c4ca..afc65ef6cd7 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/selections/CatQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.deprecated_merged_field.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.deprecated_merged_field.fragment.selections.AnimalFragmentSelections import com.example.deprecated_merged_field.type.Cat +import com.example.deprecated_merged_field.type.GraphQLString import kotlin.collections.List public object CatQuerySelections { private val cat: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Animal", diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4509f504abe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..43dd61411f8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..83e0457be7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..7383c025997 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..1b78b642978 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecated_merged_field/kotlin/responseBased/deprecated_merged_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecated_merged_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/selections/TestQuerySelections.java.expected index 593f0ac3e6d..42e26c93753 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/selections/TestQuerySelections.java.expected @@ -7,19 +7,20 @@ package com.example.deprecation.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.example.deprecation.type.Character; +import com.example.deprecation.type.GraphQLBoolean; +import com.example.deprecation.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("deprecated", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("deprecatedBool", new CompiledNotNullType(CompiledGraphQL.CompiledBooleanType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("deprecated", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("deprecatedBool", new CompiledNotNullType(GraphQLBoolean.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..bb5bcc234fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..7da3e5fadab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLID.java.expected new file mode 100644 index 00000000000..9ecc164e893 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..fe874e3f044 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLString.java.expected new file mode 100644 index 00000000000..ae1dd53d5f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/java/operationBased/deprecation/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/selections/TestQuerySelections.kt.expected index 8514f592776..31fd0bba7d5 100644 --- a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/selections/TestQuerySelections.kt.expected @@ -6,28 +6,28 @@ package com.example.deprecation.selections import com.apollographql.apollo3.api.CompiledArgument -import com.apollographql.apollo3.api.CompiledBooleanType import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull import com.example.deprecation.type.Character +import com.example.deprecation.type.GraphQLBoolean +import com.example.deprecation.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "deprecated", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "deprecatedBool", - type = CompiledBooleanType.notNull() + type = GraphQLBoolean.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..68655b7f0a7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d93b0445fad --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4907a439720 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..660ef7cbe5c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3133fdc2e21 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/deprecation/kotlin/responseBased/deprecation/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.deprecation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..acd49238538 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..1d1a4571a3c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLID.java.expected new file mode 100644 index 00000000000..d93bb5dff13 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..860246851af --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLString.java.expected new file mode 100644 index 00000000000..c8fbbe388f5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/java/operationBased/empty/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..697745150f6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..9b50ab73bd0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..28c05b7707c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..5685b896290 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..06e331df9f4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/empty/kotlin/responseBased/empty/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.empty.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..0b29af6dc20 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..0ccf2a1e9a9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLID.java.expected new file mode 100644 index 00000000000..b2a8599602b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..fbb6eb341f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLString.java.expected new file mode 100644 index 00000000000..21145500e57 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/java/operationBased/enum_field/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..49039100360 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..b0828fe88ab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..ed574b28b6c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..7070a9d946a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..a89f944649f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enum_field/kotlin/responseBased/enum_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enum_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..e1757312f61 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..022c4e5e0dd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLID.java.expected new file mode 100644 index 00000000000..e9f895475ed --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..33d2d6da656 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLString.java.expected new file mode 100644 index 00000000000..d51509d3428 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/java/operationBased/enums_as_sealed/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..03f7c759724 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fbc8a92601a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..bf2118e89f1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..8ccfa6aba05 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..2a8987264fd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.enums_as_sealed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/selections/TestQuerySelections.java.expected index b5e5e80d2c8..dfb8fa60ed1 100644 --- a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/selections/TestQuerySelections.java.expected @@ -7,21 +7,22 @@ package com.example.field_with_include_directive.selections; import com.apollographql.apollo3.api.CompiledCondition; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.field_with_include_directive.type.Character; import com.example.field_with_include_directive.type.FriendsConnection; +import com.example.field_with_include_directive.type.GraphQLInt; +import com.example.field_with_include_directive.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build() + new CompiledField.Builder("totalCount", GraphQLInt.type).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).condition(Arrays.asList(new CompiledCondition("includeName", false))).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).condition(Arrays.asList(new CompiledCondition("includeName", false))).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).condition(Arrays.asList(new CompiledCondition("skipFriends", true))).selections(friendsConnection).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..f92ff1d7b74 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..74ea30a6336 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLID.java.expected new file mode 100644 index 00000000000..31667a1634e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..1290bcc7cef --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLString.java.expected new file mode 100644 index 00000000000..6c55b0d78e4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/java/operationBased/field_with_include_directive/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/selections/TestQuerySelections.kt.expected index 6eac89b30aa..84a2ce71ed0 100644 --- a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/selections/TestQuerySelections.kt.expected @@ -7,26 +7,26 @@ package com.example.field_with_include_directive.selections import com.apollographql.apollo3.api.CompiledCondition import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.field_with_include_directive.type.Character import com.example.field_with_include_directive.type.FriendsConnection +import com.example.field_with_include_directive.type.GraphQLInt +import com.example.field_with_include_directive.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).condition(listOf(CompiledCondition("includeName", false))) .build(), CompiledField.Builder( diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ec68a23b0fa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..21f599a1ba7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..b2481e8a984 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d068784363c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..6bfcb4ad96c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/field_with_include_directive/kotlin/responseBased/field_with_include_directive/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.field_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.java.expected index 6434cbcf5de..1156a0d6bd7 100644 --- a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.java.expected @@ -7,36 +7,36 @@ package com.example.fieldset_with_multiple_super.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fieldset_with_multiple_super.type.C; +import com.example.fieldset_with_multiple_super.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onB = Arrays.asList( - new CompiledField.Builder("fieldB1", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldB1", GraphQLString.type).build() ); private static List onA = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("fieldA1", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("fieldA1", GraphQLString.type).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "BC")).selections(onB).build() ); private static List onA1 = Arrays.asList( - new CompiledField.Builder("fieldA2", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldA2", GraphQLString.type).build() ); private static List onB1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("fieldB2", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("fieldB2", GraphQLString.type).build(), new CompiledFragment.Builder("A", Arrays.asList("ABC", "AC")).selections(onA1).build() ); private static List c = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("A", Arrays.asList("ABC", "AC")).selections(onA).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "BC")).selections(onB1).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..d8ebc7758d2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..2af0344c1b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLID.java.expected new file mode 100644 index 00000000000..82fa32147cf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..7265e0b48f4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLString.java.expected new file mode 100644 index 00000000000..aca3ab93af4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/java/operationBased/fieldset_with_multiple_super/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected index 126aa1d5a0c..c9dbb6492ae 100644 --- a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.fieldset_with_multiple_super.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fieldset_with_multiple_super.type.C +import com.example.fieldset_with_multiple_super.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -40,18 +40,18 @@ public object TestQuerySelections { private val onA1: List = listOf( CompiledField.Builder( name = "fieldA2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onB1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldB2", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "A", @@ -63,7 +63,7 @@ public object TestQuerySelections { private val c: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b0589f5c638 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d31d987f78f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..be770396c8b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d5b0d5beef8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..79ddaf6203e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/compat/fieldset_with_multiple_super/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected index 126aa1d5a0c..c9dbb6492ae 100644 --- a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.fieldset_with_multiple_super.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fieldset_with_multiple_super.type.C +import com.example.fieldset_with_multiple_super.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -40,18 +40,18 @@ public object TestQuerySelections { private val onA1: List = listOf( CompiledField.Builder( name = "fieldA2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onB1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldB2", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "A", @@ -63,7 +63,7 @@ public object TestQuerySelections { private val c: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b0589f5c638 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d31d987f78f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..be770396c8b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d5b0d5beef8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..79ddaf6203e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/operationBased/fieldset_with_multiple_super/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected index 126aa1d5a0c..c9dbb6492ae 100644 --- a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.fieldset_with_multiple_super.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fieldset_with_multiple_super.type.C +import com.example.fieldset_with_multiple_super.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -40,18 +40,18 @@ public object TestQuerySelections { private val onA1: List = listOf( CompiledField.Builder( name = "fieldA2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onB1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldB2", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "A", @@ -63,7 +63,7 @@ public object TestQuerySelections { private val c: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b0589f5c638 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d31d987f78f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..be770396c8b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d5b0d5beef8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..79ddaf6203e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fieldset_with_multiple_super/kotlin/responseBased/fieldset_with_multiple_super/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fieldset_with_multiple_super.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.java.expected index 4e5536a99e7..8fe199022ac 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.java.expected @@ -6,14 +6,14 @@ package com.example.fragment_spread_with_include_directive.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_spread_with_include_directive.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.java.expected index 36a62753130..e635eb2c852 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.java.expected @@ -6,13 +6,13 @@ package com.example.fragment_spread_with_include_directive.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_spread_with_include_directive.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("homePlanet", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("homePlanet", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.java.expected index 50397d1cb2e..5e42abdb4eb 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.java.expected @@ -8,19 +8,20 @@ package com.example.fragment_spread_with_include_directive.selections; import com.apollographql.apollo3.api.CompiledCondition; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_spread_with_include_directive.fragment.selections.HeroDetailsSelections; import com.example.fragment_spread_with_include_directive.fragment.selections.HumanDetailsSelections; import com.example.fragment_spread_with_include_directive.type.Character; +import com.example.fragment_spread_with_include_directive.type.GraphQLID; +import com.example.fragment_spread_with_include_directive.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).condition(Arrays.asList(new CompiledCondition("withDetails", false), new CompiledCondition("skipHumanDetails", true))).selections(HeroDetailsSelections.root).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).condition(Arrays.asList(new CompiledCondition("withDetails", false))).selections(HumanDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..bb1c690164b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..f43584b8c24 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLID.java.expected new file mode 100644 index 00000000000..ad5c46cbea0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..19b9f9bb449 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLString.java.expected new file mode 100644 index 00000000000..dad751a08c8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/java/operationBased/fragment_spread_with_include_directive/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected index 5e1ec72b62c..78d27cad9c7 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragment_spread_with_include_directive.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_spread_with_include_directive.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected index 98d08cabd6c..8fc421f6491 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.fragment_spread_with_include_directive.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.fragment_spread_with_include_directive.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected index 4d08ab62fde..83d46644aaa 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected @@ -8,24 +8,24 @@ package com.example.fragment_spread_with_include_directive.selections import com.apollographql.apollo3.api.CompiledCondition import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_include_directive.fragment.selections.HeroDetailsSelections import com.example.fragment_spread_with_include_directive.fragment.selections.HumanDetailsSelections import com.example.fragment_spread_with_include_directive.type.Character +import com.example.fragment_spread_with_include_directive.type.GraphQLID +import com.example.fragment_spread_with_include_directive.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b0661d41a41 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..de56d5006ca --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..1956ede61b6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f2074b832d8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..5d3d7ed7018 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/compat/fragment_spread_with_include_directive/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected index 5e1ec72b62c..78d27cad9c7 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HeroDetailsSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragment_spread_with_include_directive.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_spread_with_include_directive.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected index 98d08cabd6c..8fc421f6491 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.fragment_spread_with_include_directive.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.fragment_spread_with_include_directive.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected index 4d08ab62fde..83d46644aaa 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/selections/TestQuerySelections.kt.expected @@ -8,24 +8,24 @@ package com.example.fragment_spread_with_include_directive.selections import com.apollographql.apollo3.api.CompiledCondition import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_include_directive.fragment.selections.HeroDetailsSelections import com.example.fragment_spread_with_include_directive.fragment.selections.HumanDetailsSelections import com.example.fragment_spread_with_include_directive.type.Character +import com.example.fragment_spread_with_include_directive.type.GraphQLID +import com.example.fragment_spread_with_include_directive.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b0661d41a41 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..de56d5006ca --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..1956ede61b6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f2074b832d8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..5d3d7ed7018 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_include_directive/kotlin/operationBased/fragment_spread_with_include_directive/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.java.expected index 737492671a0..3d0a82cebf4 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.java.expected @@ -6,19 +6,20 @@ package com.example.fragment_spread_with_nested_fields.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_spread_with_nested_fields.type.Character; import com.example.fragment_spread_with_nested_fields.type.FriendsConnection; import com.example.fragment_spread_with_nested_fields.type.FriendsEdge; +import com.example.fragment_spread_with_nested_fields.type.GraphQLInt; +import com.example.fragment_spread_with_nested_fields.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -26,12 +27,12 @@ public class HeroDetailsSelections { ); private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.java.expected index 15c094ba619..cb4d6892497 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.java.expected @@ -7,17 +7,17 @@ package com.example.fragment_spread_with_nested_fields.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_spread_with_nested_fields.fragment.selections.HeroDetailsSelections; import com.example.fragment_spread_with_nested_fields.type.Character; +import com.example.fragment_spread_with_nested_fields.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(HeroDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..4a1b860ebef --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..8fd863fe44c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLID.java.expected new file mode 100644 index 00000000000..d11dd26d9bb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..9ae2553365e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLString.java.expected new file mode 100644 index 00000000000..dec3a44f222 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/java/operationBased/fragment_spread_with_nested_fields/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected index e6b2804b2fa..066fa74ef2e 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.fragment_spread_with_nested_fields.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_nested_fields.type.Character import com.example.fragment_spread_with_nested_fields.type.FriendsConnection import com.example.fragment_spread_with_nested_fields.type.FriendsEdge +import com.example.fragment_spread_with_nested_fields.type.GraphQLInt +import com.example.fragment_spread_with_nested_fields.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected index e3593a816ad..453bb564ff7 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.fragment_spread_with_nested_fields.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_nested_fields.fragment.selections.HeroDetailsSelections import com.example.fragment_spread_with_nested_fields.type.Character +import com.example.fragment_spread_with_nested_fields.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..790e5187ee0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d8e96834233 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..332615785c2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..89e5979cec3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..40989593d81 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/compat/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected index e6b2804b2fa..066fa74ef2e 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.fragment_spread_with_nested_fields.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_nested_fields.type.Character import com.example.fragment_spread_with_nested_fields.type.FriendsConnection import com.example.fragment_spread_with_nested_fields.type.FriendsEdge +import com.example.fragment_spread_with_nested_fields.type.GraphQLInt +import com.example.fragment_spread_with_nested_fields.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected index e3593a816ad..453bb564ff7 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.fragment_spread_with_nested_fields.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_nested_fields.fragment.selections.HeroDetailsSelections import com.example.fragment_spread_with_nested_fields.type.Character +import com.example.fragment_spread_with_nested_fields.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..790e5187ee0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d8e96834233 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..332615785c2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..89e5979cec3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..40989593d81 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/operationBased/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected index e6b2804b2fa..066fa74ef2e 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.fragment_spread_with_nested_fields.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_nested_fields.type.Character import com.example.fragment_spread_with_nested_fields.type.FriendsConnection import com.example.fragment_spread_with_nested_fields.type.FriendsEdge +import com.example.fragment_spread_with_nested_fields.type.GraphQLInt +import com.example.fragment_spread_with_nested_fields.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected index e3593a816ad..453bb564ff7 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.fragment_spread_with_nested_fields.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_spread_with_nested_fields.fragment.selections.HeroDetailsSelections import com.example.fragment_spread_with_nested_fields.type.Character +import com.example.fragment_spread_with_nested_fields.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..790e5187ee0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d8e96834233 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..332615785c2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..89e5979cec3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..40989593d81 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_spread_with_nested_fields/kotlin/responseBased/fragment_spread_with_nested_fields/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_spread_with_nested_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.java.expected index 3413ca46ecd..c7fc3c56ec0 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.java.expected @@ -6,16 +6,16 @@ package com.example.fragment_used_twice.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_used_twice.type.Date; +import com.example.fragment_used_twice.type.GraphQLString; import java.util.Arrays; import java.util.List; public class CharacterDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("birthDate", new CompiledNotNullType(Date.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.java.expected index a71817702d7..4fba74ff3ee 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.java.expected @@ -7,16 +7,16 @@ package com.example.fragment_used_twice.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_used_twice.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(CharacterDetailsSelections.root).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.java.expected index e9b435a939d..c448e3b3607 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.java.expected @@ -7,16 +7,16 @@ package com.example.fragment_used_twice.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_used_twice.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(CharacterDetailsSelections.root).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/selections/TestQuerySelections.java.expected index 08816073527..1c4b3774a50 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/selections/TestQuerySelections.java.expected @@ -7,18 +7,18 @@ package com.example.fragment_used_twice.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_used_twice.fragment.selections.HeroDetailsSelections; import com.example.fragment_used_twice.fragment.selections.HumanDetailsSelections; import com.example.fragment_used_twice.type.Character; +import com.example.fragment_used_twice.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(HeroDetailsSelections.root).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/Date.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/Date.java.expected index a2a4a016dc9..d95f61172e1 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/Date.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/Date.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * The `Date` scalar type represents date format. */ public class Date { - public static CustomScalarType type = new CustomScalarType("Date", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("Date", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..78f13601a9f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..35daeba7a38 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLID.java.expected new file mode 100644 index 00000000000..4b79176c594 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..b55529b78d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLString.java.expected new file mode 100644 index 00000000000..357c03fed54 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/java/operationBased/fragment_used_twice/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected index a9c25f21017..17a8c974c05 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected @@ -7,16 +7,16 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_used_twice.type.Date +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object CharacterDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected index 7ab3145a2e8..970dda1a64f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected @@ -8,19 +8,19 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected index 35de784af9d..98d50981cfe 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected @@ -8,19 +8,19 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/selections/TestQuerySelections.kt.expected index fdd3d2e3cd9..342f3ddb376 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragment_used_twice.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_used_twice.fragment.selections.HeroDetailsSelections import com.example.fragment_used_twice.fragment.selections.HumanDetailsSelections import com.example.fragment_used_twice.type.Character +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..138789607ec --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..edb482f28b3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..78c049daf66 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..b05166778b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..edda10bcf5d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/compat/fragment_used_twice/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected index a9c25f21017..17a8c974c05 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected @@ -7,16 +7,16 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_used_twice.type.Date +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object CharacterDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected index 7ab3145a2e8..970dda1a64f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected @@ -8,19 +8,19 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected index 35de784af9d..98d50981cfe 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected @@ -8,19 +8,19 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/selections/TestQuerySelections.kt.expected index fdd3d2e3cd9..342f3ddb376 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragment_used_twice.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_used_twice.fragment.selections.HeroDetailsSelections import com.example.fragment_used_twice.fragment.selections.HumanDetailsSelections import com.example.fragment_used_twice.type.Character +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..138789607ec --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..edb482f28b3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..78c049daf66 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..b05166778b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..edda10bcf5d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/operationBased/fragment_used_twice/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected index a9c25f21017..17a8c974c05 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/CharacterDetailsSelections.kt.expected @@ -7,16 +7,16 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_used_twice.type.Date +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object CharacterDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected index 7ab3145a2e8..970dda1a64f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HeroDetailsSelections.kt.expected @@ -8,19 +8,19 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected index 35de784af9d..98d50981cfe 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/fragment/selections/HumanDetailsSelections.kt.expected @@ -8,19 +8,19 @@ package com.example.fragment_used_twice.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/selections/TestQuerySelections.kt.expected index fdd3d2e3cd9..342f3ddb376 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragment_used_twice.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_used_twice.fragment.selections.HeroDetailsSelections import com.example.fragment_used_twice.fragment.selections.HumanDetailsSelections import com.example.fragment_used_twice.type.Character +import com.example.fragment_used_twice.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..138789607ec --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..edb482f28b3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..78c049daf66 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..b05166778b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..edda10bcf5d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_used_twice/kotlin/responseBased/fragment_used_twice/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_used_twice.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.java.expected index 8a7b7392804..d8eed95ad44 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.java.expected @@ -6,15 +6,15 @@ package com.example.fragment_with_inline_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_with_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DroidDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.java.expected index 3784b41066a..9c994ae32bf 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.java.expected @@ -7,24 +7,25 @@ package com.example.fragment_with_inline_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_with_inline_fragment.type.Character; import com.example.fragment_with_inline_fragment.type.FriendsConnection; import com.example.fragment_with_inline_fragment.type.FriendsEdge; +import com.example.fragment_with_inline_fragment.type.GraphQLInt; +import com.example.fragment_with_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { private static List onDroid = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetailsSelections.root).build() ); private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -32,15 +33,15 @@ public class HeroDetailsSelections { ); private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.java.expected index 46da24b9761..ff7f9eef2dd 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.java.expected @@ -6,14 +6,14 @@ package com.example.fragment_with_inline_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_with_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.java.expected index d9ac6553e99..52f15f1ea5d 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.java.expected @@ -7,20 +7,20 @@ package com.example.fragment_with_inline_fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_with_inline_fragment.fragment.selections.HeroDetailsSelections; import com.example.fragment_with_inline_fragment.type.Character; import com.example.fragment_with_inline_fragment.type.Episode; +import com.example.fragment_with_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(HeroDetailsSelections.root).build(), new CompiledField.Builder("appearsIn", new CompiledNotNullType(new CompiledListType(Episode.type))).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..77da5a01818 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..135178f34f1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..d30d7f1d428 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..077c0e63f75 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..a741cc1d267 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/java/operationBased/fragment_with_inline_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected index d902566bae9..09694c72585 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected index 0dc2c23aa83..f797701578c 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected @@ -7,21 +7,21 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_with_inline_fragment.type.Character import com.example.fragment_with_inline_fragment.type.FriendsConnection import com.example.fragment_with_inline_fragment.type.FriendsEdge +import com.example.fragment_with_inline_fragment.type.GraphQLInt +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val onDroid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -33,7 +33,7 @@ public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -48,7 +48,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -60,7 +60,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -74,7 +74,7 @@ public object HeroDetailsSelections { .build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected index c36f94c2c43..5e36fae9826 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected index 70f3ad170c4..c8f0c55862d 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected @@ -8,23 +8,23 @@ package com.example.fragment_with_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_with_inline_fragment.fragment.selections.HeroDetailsSelections import com.example.fragment_with_inline_fragment.type.Character import com.example.fragment_with_inline_fragment.type.Episode +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..671734a9523 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8a131954faf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..1eaa412f87e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..dad972dd460 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..502a7ec4abe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/compat/fragment_with_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected index d902566bae9..09694c72585 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected index 0dc2c23aa83..f797701578c 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected @@ -7,21 +7,21 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_with_inline_fragment.type.Character import com.example.fragment_with_inline_fragment.type.FriendsConnection import com.example.fragment_with_inline_fragment.type.FriendsEdge +import com.example.fragment_with_inline_fragment.type.GraphQLInt +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val onDroid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -33,7 +33,7 @@ public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -48,7 +48,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -60,7 +60,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -74,7 +74,7 @@ public object HeroDetailsSelections { .build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected index c36f94c2c43..5e36fae9826 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected index 70f3ad170c4..c8f0c55862d 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected @@ -8,23 +8,23 @@ package com.example.fragment_with_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_with_inline_fragment.fragment.selections.HeroDetailsSelections import com.example.fragment_with_inline_fragment.type.Character import com.example.fragment_with_inline_fragment.type.Episode +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..671734a9523 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8a131954faf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..1eaa412f87e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..dad972dd460 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..502a7ec4abe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/operationBased/fragment_with_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected index d902566bae9..09694c72585 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected index 0dc2c23aa83..f797701578c 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HeroDetailsSelections.kt.expected @@ -7,21 +7,21 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_with_inline_fragment.type.Character import com.example.fragment_with_inline_fragment.type.FriendsConnection import com.example.fragment_with_inline_fragment.type.FriendsEdge +import com.example.fragment_with_inline_fragment.type.GraphQLInt +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val onDroid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -33,7 +33,7 @@ public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -48,7 +48,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -60,7 +60,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -74,7 +74,7 @@ public object HeroDetailsSelections { .build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected index c36f94c2c43..5e36fae9826 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragment_with_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected index 70f3ad170c4..c8f0c55862d 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/selections/TestQuerySelections.kt.expected @@ -8,23 +8,23 @@ package com.example.fragment_with_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.fragment_with_inline_fragment.fragment.selections.HeroDetailsSelections import com.example.fragment_with_inline_fragment.type.Character import com.example.fragment_with_inline_fragment.type.Episode +import com.example.fragment_with_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..671734a9523 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8a131954faf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..1eaa412f87e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..dad972dd460 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..502a7ec4abe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_inline_fragment/kotlin/responseBased/fragment_with_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.java.expected index 006ea7559bb..00442ca2b5e 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.java.expected @@ -7,19 +7,19 @@ package com.example.fragment_with_multiple_fieldsets.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString; import java.util.Arrays; import java.util.List; public class iFragmentSelections { private static List onA = Arrays.asList( - new CompiledField.Builder("fieldA", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldA", GraphQLString.type).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("A", Arrays.asList("A")).selections(onA).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.java.expected index 132d6cc3b5f..225f29266ec 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.java.expected @@ -7,17 +7,17 @@ package com.example.fragment_with_multiple_fieldsets.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragment_with_multiple_fieldsets.fragment.selections.iFragmentSelections; +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString; import com.example.fragment_with_multiple_fieldsets.type.I; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List i = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("I", Arrays.asList("A", "B")).selections(iFragmentSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..5c68de9c79a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..11e4503b2cc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLID.java.expected new file mode 100644 index 00000000000..3e67a93be1e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..ed46fae72c6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLString.java.expected new file mode 100644 index 00000000000..b9bcb726947 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/java/operationBased/fragment_with_multiple_fieldsets/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected index cd33b3b7d60..a34513a22cb 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected @@ -8,22 +8,22 @@ package com.example.fragment_with_multiple_fieldsets.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString import kotlin.collections.List public object iFragmentSelections { private val onA: List = listOf( CompiledField.Builder( name = "fieldA", - type = CompiledStringType + type = GraphQLString.type ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected index 0a7dff6a5b8..f0206f6d863 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected @@ -8,9 +8,9 @@ package com.example.fragment_with_multiple_fieldsets.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_with_multiple_fieldsets.fragment.selections.iFragmentSelections +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString import com.example.fragment_with_multiple_fieldsets.type.I import kotlin.collections.List @@ -18,7 +18,7 @@ public object TestQuerySelections { private val i: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "I", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f4b2d8d9bfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..c61d385cdf5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3303887dcb7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..6d2a489be27 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..39066407651 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/compat/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected index cd33b3b7d60..a34513a22cb 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected @@ -8,22 +8,22 @@ package com.example.fragment_with_multiple_fieldsets.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString import kotlin.collections.List public object iFragmentSelections { private val onA: List = listOf( CompiledField.Builder( name = "fieldA", - type = CompiledStringType + type = GraphQLString.type ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected index 0a7dff6a5b8..f0206f6d863 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected @@ -8,9 +8,9 @@ package com.example.fragment_with_multiple_fieldsets.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_with_multiple_fieldsets.fragment.selections.iFragmentSelections +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString import com.example.fragment_with_multiple_fieldsets.type.I import kotlin.collections.List @@ -18,7 +18,7 @@ public object TestQuerySelections { private val i: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "I", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f4b2d8d9bfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..c61d385cdf5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3303887dcb7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..6d2a489be27 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..39066407651 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/operationBased/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected index cd33b3b7d60..a34513a22cb 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/fragment/selections/iFragmentSelections.kt.expected @@ -8,22 +8,22 @@ package com.example.fragment_with_multiple_fieldsets.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString import kotlin.collections.List public object iFragmentSelections { private val onA: List = listOf( CompiledField.Builder( name = "fieldA", - type = CompiledStringType + type = GraphQLString.type ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected index 0a7dff6a5b8..f0206f6d863 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected @@ -8,9 +8,9 @@ package com.example.fragment_with_multiple_fieldsets.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragment_with_multiple_fieldsets.fragment.selections.iFragmentSelections +import com.example.fragment_with_multiple_fieldsets.type.GraphQLString import com.example.fragment_with_multiple_fieldsets.type.I import kotlin.collections.List @@ -18,7 +18,7 @@ public object TestQuerySelections { private val i: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "I", diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f4b2d8d9bfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..c61d385cdf5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3303887dcb7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..6d2a489be27 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..39066407651 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragment_with_multiple_fieldsets/kotlin/responseBased/fragment_with_multiple_fieldsets/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragment_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.java.expected index 283bf2281e5..706ce4be71f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.java.expected @@ -6,14 +6,14 @@ package com.example.fragments_same_type_condition.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragments_same_type_condition.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DroidDetails1Selections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.java.expected index 40bced8d5ea..013bda829c4 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.java.expected @@ -6,13 +6,13 @@ package com.example.fragments_same_type_condition.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragments_same_type_condition.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DroidDetails2Selections { public static List root = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/selections/TestQuerySelections.java.expected index 0f6d66bf6f9..97833fc1837 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/selections/TestQuerySelections.java.expected @@ -7,18 +7,18 @@ package com.example.fragments_same_type_condition.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragments_same_type_condition.fragment.selections.DroidDetails1Selections; import com.example.fragments_same_type_condition.fragment.selections.DroidDetails2Selections; import com.example.fragments_same_type_condition.type.Character; +import com.example.fragments_same_type_condition.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetails1Selections.root).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetails2Selections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..993f9c48bef --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..ed210333aba --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLID.java.expected new file mode 100644 index 00000000000..d706300f189 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..a14d11f150e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLString.java.expected new file mode 100644 index 00000000000..efc2cbca1ba --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/java/operationBased/fragments_same_type_condition/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected index 0eb416a8bd6..09d57e82ad5 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragments_same_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetails1Selections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected index 0cc59fb101f..c18317bd228 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.fragments_same_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetails2Selections { public val root: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/selections/TestQuerySelections.kt.expected index b64adee8424..50a7553d81f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragments_same_type_condition.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragments_same_type_condition.fragment.selections.DroidDetails1Selections import com.example.fragments_same_type_condition.fragment.selections.DroidDetails2Selections import com.example.fragments_same_type_condition.type.Character +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..9510b78df9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..20f8adaaf78 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..32b0dca13c1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2c8d9ea1fb0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..307efc94bc7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/compat/fragments_same_type_condition/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected index 0eb416a8bd6..09d57e82ad5 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragments_same_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetails1Selections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected index 0cc59fb101f..c18317bd228 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.fragments_same_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetails2Selections { public val root: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected index b64adee8424..50a7553d81f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragments_same_type_condition.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragments_same_type_condition.fragment.selections.DroidDetails1Selections import com.example.fragments_same_type_condition.fragment.selections.DroidDetails2Selections import com.example.fragments_same_type_condition.type.Character +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..9510b78df9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..20f8adaaf78 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..32b0dca13c1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2c8d9ea1fb0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..307efc94bc7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/operationBased/fragments_same_type_condition/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected index 0eb416a8bd6..09d57e82ad5 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails1Selections.kt.expected @@ -7,15 +7,15 @@ package com.example.fragments_same_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetails1Selections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected index 0cc59fb101f..c18317bd228 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/fragment/selections/DroidDetails2Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.fragments_same_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetails2Selections { public val root: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected index b64adee8424..50a7553d81f 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragments_same_type_condition.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragments_same_type_condition.fragment.selections.DroidDetails1Selections import com.example.fragments_same_type_condition.fragment.selections.DroidDetails2Selections import com.example.fragments_same_type_condition.type.Character +import com.example.fragments_same_type_condition.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..9510b78df9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..20f8adaaf78 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..32b0dca13c1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2c8d9ea1fb0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..307efc94bc7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_same_type_condition/kotlin/responseBased/fragments_same_type_condition/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_same_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.java.expected index edbedf02414..03c809cce7a 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.java.expected @@ -6,15 +6,15 @@ package com.example.fragments_with_type_condition.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragments_with_type_condition.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DroidDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.java.expected index e34b0cba1f2..7331af184d5 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.java.expected @@ -6,15 +6,16 @@ package com.example.fragments_with_type_condition.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.fragments_with_type_condition.type.GraphQLFloat; +import com.example.fragments_with_type_condition.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("height", GraphQLFloat.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/selections/TestQuerySelections.java.expected index 39351e04a45..dcd3dafa532 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/selections/TestQuerySelections.java.expected @@ -7,24 +7,24 @@ package com.example.fragments_with_type_condition.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.fragments_with_type_condition.fragment.selections.DroidDetailsSelections; import com.example.fragments_with_type_condition.fragment.selections.HumanDetailsSelections; import com.example.fragments_with_type_condition.type.Character; +import com.example.fragments_with_type_condition.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List r2 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetailsSelections.root).build() ); private static List luke = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..e7c631f299d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..494db98d6e1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLID.java.expected new file mode 100644 index 00000000000..dea8bd68b1b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..92ad3ce13ae --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLString.java.expected new file mode 100644 index 00000000000..597c1af82cb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/java/operationBased/fragments_with_type_condition/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected index 43e710fa742..0121b6004be 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.fragments_with_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected index d0ac216cea9..0f87e2aedcf 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.fragments_with_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_with_type_condition.type.GraphQLFloat +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/selections/TestQuerySelections.kt.expected index d84ef9cd261..36690efe617 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragments_with_type_condition.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragments_with_type_condition.fragment.selections.DroidDetailsSelections import com.example.fragments_with_type_condition.fragment.selections.HumanDetailsSelections import com.example.fragments_with_type_condition.type.Character +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val r2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -36,7 +36,7 @@ public object TestQuerySelections { private val luke: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c93f719bed8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..315450212c4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7a36119daff --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..81ea8b2c29c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fbc913b2423 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/compat/fragments_with_type_condition/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected index 43e710fa742..0121b6004be 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.fragments_with_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected index d0ac216cea9..0f87e2aedcf 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.fragments_with_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_with_type_condition.type.GraphQLFloat +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected index d84ef9cd261..36690efe617 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragments_with_type_condition.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragments_with_type_condition.fragment.selections.DroidDetailsSelections import com.example.fragments_with_type_condition.fragment.selections.HumanDetailsSelections import com.example.fragments_with_type_condition.type.Character +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val r2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -36,7 +36,7 @@ public object TestQuerySelections { private val luke: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c93f719bed8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..315450212c4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7a36119daff --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..81ea8b2c29c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fbc913b2423 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/operationBased/fragments_with_type_condition/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected index 43e710fa742..0121b6004be 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.fragments_with_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected index d0ac216cea9..0f87e2aedcf 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/fragment/selections/HumanDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.fragments_with_type_condition.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.fragments_with_type_condition.type.GraphQLFloat +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected index d84ef9cd261..36690efe617 100644 --- a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.fragments_with_type_condition.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.fragments_with_type_condition.fragment.selections.DroidDetailsSelections import com.example.fragments_with_type_condition.fragment.selections.HumanDetailsSelections import com.example.fragments_with_type_condition.type.Character +import com.example.fragments_with_type_condition.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val r2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -36,7 +36,7 @@ public object TestQuerySelections { private val luke: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c93f719bed8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..315450212c4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7a36119daff --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..81ea8b2c29c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fbc913b2423 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/fragments_with_type_condition/kotlin/responseBased/fragments_with_type_condition/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.fragments_with_type_condition.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/selections/HeroDetailsSelections.java.expected index 30b71a72b61..c4c053edd72 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/selections/HeroDetailsSelections.java.expected @@ -6,20 +6,21 @@ package com.example.hero_details.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.hero_details.type.Character; import com.example.hero_details.type.FriendsConnection; import com.example.hero_details.type.FriendsEdge; +import com.example.hero_details.type.GraphQLInt; +import com.example.hero_details.type.GraphQLString; import com.example.hero_details.type.hero_type; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -27,13 +28,13 @@ public class HeroDetailsSelections { ); private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges).build() ); private static List hero = Arrays.asList( new CompiledField.Builder("type", new CompiledNotNullType(hero_type.type)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..f93bb52374b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..bf227240797 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLID.java.expected new file mode 100644 index 00000000000..4bbad8bcf1e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..f6b62bcf47f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLString.java.expected new file mode 100644 index 00000000000..5cebb852f4a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/java/operationBased/hero_details/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/selections/HeroDetailsSelections.kt.expected index fe7f1f6d57f..db2641d2ee6 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/selections/HeroDetailsSelections.kt.expected @@ -6,14 +6,14 @@ package com.example.hero_details.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.hero_details.type.Character import com.example.hero_details.type.FriendsConnection import com.example.hero_details.type.FriendsEdge +import com.example.hero_details.type.GraphQLInt +import com.example.hero_details.type.GraphQLString import com.example.hero_details.type.hero_type import kotlin.collections.List @@ -21,7 +21,7 @@ public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -36,7 +36,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -52,7 +52,7 @@ public object HeroDetailsSelections { ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..516bab36a9f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..cd4eaada6d6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..17ca254ca1a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..fb5e742276c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fef204e60f3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details/kotlin/responseBased/hero_details/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.java.expected index 31203d4fe5a..3e91fc29b9a 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.java.expected @@ -6,19 +6,20 @@ package com.example.hero_details_semantic_naming.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.hero_details_semantic_naming.type.Character; import com.example.hero_details_semantic_naming.type.FriendsConnection; import com.example.hero_details_semantic_naming.type.FriendsEdge; +import com.example.hero_details_semantic_naming.type.GraphQLInt; +import com.example.hero_details_semantic_naming.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsQuerySelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -26,12 +27,12 @@ public class HeroDetailsQuerySelections { ); private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..3abf10f4c38 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..4f596671fce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLID.java.expected new file mode 100644 index 00000000000..f8244394882 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..05f7f71a0b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLString.java.expected new file mode 100644 index 00000000000..68c014a2896 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/java/operationBased/hero_details_semantic_naming/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.kt.expected index e940bde49bc..5d6122cb4aa 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/selections/HeroDetailsQuerySelections.kt.expected @@ -6,21 +6,21 @@ package com.example.hero_details_semantic_naming.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.hero_details_semantic_naming.type.Character import com.example.hero_details_semantic_naming.type.FriendsConnection import com.example.hero_details_semantic_naming.type.FriendsEdge +import com.example.hero_details_semantic_naming.type.GraphQLInt +import com.example.hero_details_semantic_naming.type.GraphQLString import kotlin.collections.List public object HeroDetailsQuerySelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsQuerySelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..08d453ba28d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..216803e57e1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..b34b01719c8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..e895d82593f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..dd188057724 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_details_semantic_naming/kotlin/responseBased/hero_details_semantic_naming/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_details_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/selections/TestQuerySelections.java.expected index 85df56b6ed9..412c3cba929 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/selections/TestQuerySelections.java.expected @@ -7,22 +7,22 @@ package com.example.hero_name.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.hero_name.type.Character; import com.example.hero_name.type.Date; +import com.example.hero_name.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onDroid = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("birthDate", new CompiledNotNullType(Date.type)).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/Date.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/Date.java.expected index 94264562cef..ff1c5b95841 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/Date.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/Date.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * The `Date` scalar type represents date format. */ public class Date { - public static CustomScalarType type = new CustomScalarType("Date", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("Date", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..1f180b21a83 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..1fe73888d0f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLID.java.expected new file mode 100644 index 00000000000..fd439a7532b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..bcafc278dc6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLString.java.expected new file mode 100644 index 00000000000..13bafa33283 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/java/operationBased/hero_name/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/selections/TestQuerySelections.kt.expected index a5ebf46f4a0..3d740855ca2 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/selections/TestQuerySelections.kt.expected @@ -8,28 +8,28 @@ package com.example.hero_name.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.hero_name.type.Character import com.example.hero_name.type.Date +import com.example.hero_name.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..da99519292a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..51a42b71852 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..41523e61bca --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..8864f67d018 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..1366e7465af --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/compat/hero_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/selections/TestQuerySelections.kt.expected index a5ebf46f4a0..3d740855ca2 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/selections/TestQuerySelections.kt.expected @@ -8,28 +8,28 @@ package com.example.hero_name.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.hero_name.type.Character import com.example.hero_name.type.Date +import com.example.hero_name.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..da99519292a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..51a42b71852 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..41523e61bca --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..8864f67d018 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..1366e7465af --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/operationBased/hero_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/selections/TestQuerySelections.kt.expected index a5ebf46f4a0..3d740855ca2 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/selections/TestQuerySelections.kt.expected @@ -8,28 +8,28 @@ package com.example.hero_name.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.hero_name.type.Character import com.example.hero_name.type.Date +import com.example.hero_name.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "birthDate", diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..da99519292a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..51a42b71852 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..41523e61bca --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..8864f67d018 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..1366e7465af --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name/kotlin/responseBased/hero_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.java.expected index 76a19163ce2..3954b55c526 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.java.expected @@ -7,17 +7,17 @@ package com.example.hero_name_query_long_name.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.example.hero_name_query_long_name.type.Character; +import com.example.hero_name_query_long_name.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections { private static List heroAVeryAVeryAVeryAVeryAVeryAVeryAV = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).alias("nameAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongName").build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).alias("nameAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongName").build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..315ae356d61 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..9a86a995b55 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLID.java.expected new file mode 100644 index 00000000000..42e15712a69 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..db3e10708f6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLString.java.expected new file mode 100644 index 00000000000..5758aaa9c1a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/java/operationBased/hero_name_query_long_name/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.kt.expected index e3faff3342d..f16fa765c81 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/selections/TestQueryWithAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongNameSelections.kt.expected @@ -8,10 +8,10 @@ package com.example.hero_name_query_long_name.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull import com.example.hero_name_query_long_name.type.Character +import com.example.hero_name_query_long_name.type.GraphQLString import kotlin.collections.List public object @@ -20,7 +20,7 @@ public object private val heroAVeryAVeryAVeryAVeryAVeryAVeryAV: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).alias("nameAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryAVeryLongName") .build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..9898f9cb040 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..355e541a8e8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..cd5415887db --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..73a92e9076e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f8dd709d002 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_name_query_long_name/kotlin/responseBased/hero_name_query_long_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_name_query_long_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/selections/TestQuerySelections.java.expected index 7b000ed4a4e..f5b5a764e5a 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/selections/TestQuerySelections.java.expected @@ -7,19 +7,20 @@ package com.example.hero_with_review.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.apollographql.apollo3.api.ImmutableMapBuilder; +import com.example.hero_with_review.type.GraphQLInt; +import com.example.hero_with_review.type.GraphQLString; import com.example.hero_with_review.type.Review; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List createReview = Arrays.asList( - new CompiledField.Builder("stars", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).build(), - new CompiledField.Builder("commentary", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("stars", new CompiledNotNullType(GraphQLInt.type)).build(), + new CompiledField.Builder("commentary", GraphQLString.type).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..268a5524559 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..08b14a96de6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLID.java.expected new file mode 100644 index 00000000000..6abe3de6efa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..7f071578f0e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLString.java.expected new file mode 100644 index 00000000000..620aa6424d9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/java/operationBased/hero_with_review/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/selections/TestQuerySelections.kt.expected index 89675f656fc..ee92b7a59f1 100644 --- a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/selections/TestQuerySelections.kt.expected @@ -7,11 +7,11 @@ package com.example.hero_with_review.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.hero_with_review.type.GraphQLInt +import com.example.hero_with_review.type.GraphQLString import com.example.hero_with_review.type.Review import kotlin.collections.List @@ -19,11 +19,11 @@ public object TestQuerySelections { private val createReview: List = listOf( CompiledField.Builder( name = "stars", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).build(), CompiledField.Builder( name = "commentary", - type = CompiledStringType + type = GraphQLString.type ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..fd938fb4297 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a4bfff4eef8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7cd65845df7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..4ad12958df4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..af64afdeaf6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/hero_with_review/kotlin/responseBased/hero_with_review/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.hero_with_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.java.expected index 5d998a7625f..c7cd3f1ab4a 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.java.expected @@ -8,21 +8,22 @@ package com.example.inline_fragment_for_non_optional_field.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.inline_fragment_for_non_optional_field.type.Character; +import com.example.inline_fragment_for_non_optional_field.type.GraphQLFloat; +import com.example.inline_fragment_for_non_optional_field.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("height", GraphQLFloat.type).build() ); private static List nonOptionalHero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..40ac244eb80 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..2c043fd96ce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLID.java.expected new file mode 100644 index 00000000000..0cc252036d9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..970dcb6dbd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLString.java.expected new file mode 100644 index 00000000000..799f3b1215b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/java/operationBased/inline_fragment_for_non_optional_field/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected index 85a96590eb5..41719b51062 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected @@ -7,30 +7,30 @@ package com.example.inline_fragment_for_non_optional_field.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_for_non_optional_field.type.Character +import com.example.inline_fragment_for_non_optional_field.type.GraphQLFloat +import com.example.inline_fragment_for_non_optional_field.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val nonOptionalHero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f720c9f4abc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a07d7f5ed48 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7b5052be457 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d8496a09edb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f7bc8489053 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/compat/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected index 85a96590eb5..41719b51062 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected @@ -7,30 +7,30 @@ package com.example.inline_fragment_for_non_optional_field.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_for_non_optional_field.type.Character +import com.example.inline_fragment_for_non_optional_field.type.GraphQLFloat +import com.example.inline_fragment_for_non_optional_field.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val nonOptionalHero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f720c9f4abc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a07d7f5ed48 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7b5052be457 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d8496a09edb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f7bc8489053 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/operationBased/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected index 85a96590eb5..41719b51062 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/selections/TestQuerySelections.kt.expected @@ -7,30 +7,30 @@ package com.example.inline_fragment_for_non_optional_field.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_for_non_optional_field.type.Character +import com.example.inline_fragment_for_non_optional_field.type.GraphQLFloat +import com.example.inline_fragment_for_non_optional_field.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val nonOptionalHero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f720c9f4abc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a07d7f5ed48 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..7b5052be457 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d8496a09edb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f7bc8489053 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_for_non_optional_field/kotlin/responseBased/inline_fragment_for_non_optional_field/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_for_non_optional_field.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.java.expected index ea37f81643d..b314cae8ecc 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.java.expected @@ -8,32 +8,32 @@ package com.example.inline_fragment_inside_inline_fragment.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.inline_fragment_inside_inline_fragment.type.GraphQLString; import com.example.inline_fragment_inside_inline_fragment.type.SearchResult; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onHuman = Arrays.asList( - new CompiledField.Builder("homePlanet", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("homePlanet", GraphQLString.type).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List onCharacter = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); private static List search = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..36c597b348f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..f632ed2fa63 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..ad8dc1a93fe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..19f218dc37f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..7ad05d1f495 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/java/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected index 55623517ce9..25cb03be1ce 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected @@ -9,9 +9,9 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.inline_fragment_inside_inline_fragment.type.GraphQLString import com.example.inline_fragment_inside_inline_fragment.type.SearchResult import kotlin.collections.List @@ -19,25 +19,25 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -54,7 +54,7 @@ public object TestQuerySelections { private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..d7c35de25a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..6f78b7ca9e9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3f353434255 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..9cd1465df1a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3a6c4391a46 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/compat/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected index 55623517ce9..25cb03be1ce 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected @@ -9,9 +9,9 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.inline_fragment_inside_inline_fragment.type.GraphQLString import com.example.inline_fragment_inside_inline_fragment.type.SearchResult import kotlin.collections.List @@ -19,25 +19,25 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -54,7 +54,7 @@ public object TestQuerySelections { private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..d7c35de25a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..6f78b7ca9e9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3f353434255 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..9cd1465df1a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3a6c4391a46 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/operationBased/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected index 55623517ce9..25cb03be1ce 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/selections/TestQuerySelections.kt.expected @@ -9,9 +9,9 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.inline_fragment_inside_inline_fragment.type.GraphQLString import com.example.inline_fragment_inside_inline_fragment.type.SearchResult import kotlin.collections.List @@ -19,25 +19,25 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -54,7 +54,7 @@ public object TestQuerySelections { private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..d7c35de25a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..6f78b7ca9e9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3f353434255 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..9cd1465df1a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3a6c4391a46 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_inside_inline_fragment/kotlin/responseBased/inline_fragment_inside_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/selections/TestOperationSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/selections/TestOperationSelections.java.expected index 86c250b45c9..43326781db3 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/selections/TestOperationSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/selections/TestOperationSelections.java.expected @@ -7,24 +7,26 @@ package com.example.inline_fragment_intersection.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.inline_fragment_intersection.type.Anything; import com.example.inline_fragment_intersection.type.Being; +import com.example.inline_fragment_intersection.type.GraphQLBoolean; +import com.example.inline_fragment_intersection.type.GraphQLFloat; +import com.example.inline_fragment_intersection.type.GraphQLString; import com.example.inline_fragment_intersection.type.Race; import java.util.Arrays; import java.util.List; public class TestOperationSelections { private static List onWookie = Arrays.asList( - new CompiledField.Builder("lifeExpectancy", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("lifeExpectancy", GraphQLFloat.type).build() ); private static List friends = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Wookie", Arrays.asList("Wookie")).selections(onWookie).build() ); @@ -33,25 +35,25 @@ public class TestOperationSelections { ); private static List friends1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("isFamous", CompiledGraphQL.CompiledBooleanType).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("isFamous", GraphQLBoolean.type).build(), new CompiledFragment.Builder("Wookie", Arrays.asList("Wookie")).selections(onWookie1).build() ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("profilePictureUrl", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("profilePictureUrl", GraphQLString.type).build(), new CompiledField.Builder("friends", new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Being.type)))).selections(friends1).build() ); private static List onBeing = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friends", new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Being.type)))).selections(friends).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build() ); private static List friends2 = Arrays.asList( - new CompiledField.Builder("lifeExpectancy", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("lifeExpectancy", GraphQLFloat.type).build() ); private static List onWookie2 = Arrays.asList( @@ -60,11 +62,11 @@ public class TestOperationSelections { ); private static List onWookie3 = Arrays.asList( - new CompiledField.Builder("lifeExpectancy", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("lifeExpectancy", GraphQLFloat.type).build() ); private static List friends3 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Wookie", Arrays.asList("Wookie")).selections(onWookie3).build() ); @@ -73,7 +75,7 @@ public class TestOperationSelections { ); private static List random = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Being", Arrays.asList("Human", "Wookie")).selections(onBeing).build(), new CompiledFragment.Builder("Wookie", Arrays.asList("Wookie")).selections(onWookie2).build(), new CompiledFragment.Builder("Being", Arrays.asList("Human", "Wookie")).selections(onBeing1).build() diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..4819c8d08f2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..aa54d63253d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLID.java.expected new file mode 100644 index 00000000000..5d04c3c68ed --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..0349f051cc9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLString.java.expected new file mode 100644 index 00000000000..50b3cfdc52b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/java/operationBased/inline_fragment_intersection/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/selections/TestOperationSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/selections/TestOperationSelections.kt.expected index 8956dff83b3..b3d954afba1 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/selections/TestOperationSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/selections/TestOperationSelections.kt.expected @@ -5,16 +5,16 @@ // package com.example.inline_fragment_intersection.selections -import com.apollographql.apollo3.api.CompiledBooleanType import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_intersection.type.Anything import com.example.inline_fragment_intersection.type.Being +import com.example.inline_fragment_intersection.type.GraphQLBoolean +import com.example.inline_fragment_intersection.type.GraphQLFloat +import com.example.inline_fragment_intersection.type.GraphQLString import com.example.inline_fragment_intersection.type.Race import kotlin.collections.List @@ -22,18 +22,18 @@ public object TestOperationSelections { private val onWookie: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -52,11 +52,11 @@ public object TestOperationSelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "isFamous", - type = CompiledBooleanType + type = GraphQLBoolean.type ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -68,7 +68,7 @@ public object TestOperationSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "profilePictureUrl", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -80,11 +80,11 @@ public object TestOperationSelections { private val onBeing: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", @@ -101,7 +101,7 @@ public object TestOperationSelections { private val friends2: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) @@ -120,14 +120,14 @@ public object TestOperationSelections { private val onWookie3: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val friends3: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -147,7 +147,7 @@ public object TestOperationSelections { private val random: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Being", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..6443aa65c63 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5f03c4c5ec4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8577af91d6e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..aa926e70cde --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..94c207732b6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/compat/inline_fragment_intersection/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected index 8956dff83b3..b3d954afba1 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected @@ -5,16 +5,16 @@ // package com.example.inline_fragment_intersection.selections -import com.apollographql.apollo3.api.CompiledBooleanType import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_intersection.type.Anything import com.example.inline_fragment_intersection.type.Being +import com.example.inline_fragment_intersection.type.GraphQLBoolean +import com.example.inline_fragment_intersection.type.GraphQLFloat +import com.example.inline_fragment_intersection.type.GraphQLString import com.example.inline_fragment_intersection.type.Race import kotlin.collections.List @@ -22,18 +22,18 @@ public object TestOperationSelections { private val onWookie: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -52,11 +52,11 @@ public object TestOperationSelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "isFamous", - type = CompiledBooleanType + type = GraphQLBoolean.type ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -68,7 +68,7 @@ public object TestOperationSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "profilePictureUrl", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -80,11 +80,11 @@ public object TestOperationSelections { private val onBeing: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", @@ -101,7 +101,7 @@ public object TestOperationSelections { private val friends2: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) @@ -120,14 +120,14 @@ public object TestOperationSelections { private val onWookie3: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val friends3: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -147,7 +147,7 @@ public object TestOperationSelections { private val random: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Being", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..6443aa65c63 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5f03c4c5ec4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8577af91d6e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..aa926e70cde --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..94c207732b6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/operationBased/inline_fragment_intersection/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected index 8956dff83b3..b3d954afba1 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/selections/TestOperationSelections.kt.expected @@ -5,16 +5,16 @@ // package com.example.inline_fragment_intersection.selections -import com.apollographql.apollo3.api.CompiledBooleanType import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_intersection.type.Anything import com.example.inline_fragment_intersection.type.Being +import com.example.inline_fragment_intersection.type.GraphQLBoolean +import com.example.inline_fragment_intersection.type.GraphQLFloat +import com.example.inline_fragment_intersection.type.GraphQLString import com.example.inline_fragment_intersection.type.Race import kotlin.collections.List @@ -22,18 +22,18 @@ public object TestOperationSelections { private val onWookie: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -52,11 +52,11 @@ public object TestOperationSelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "isFamous", - type = CompiledBooleanType + type = GraphQLBoolean.type ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -68,7 +68,7 @@ public object TestOperationSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "profilePictureUrl", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -80,11 +80,11 @@ public object TestOperationSelections { private val onBeing: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", @@ -101,7 +101,7 @@ public object TestOperationSelections { private val friends2: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) @@ -120,14 +120,14 @@ public object TestOperationSelections { private val onWookie3: List = listOf( CompiledField.Builder( name = "lifeExpectancy", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val friends3: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Wookie", @@ -147,7 +147,7 @@ public object TestOperationSelections { private val random: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Being", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..6443aa65c63 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5f03c4c5ec4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8577af91d6e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..aa926e70cde --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..94c207732b6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_intersection/kotlin/responseBased/inline_fragment_intersection/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_intersection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.java.expected index 679152ba229..ae6047e3912 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.java.expected @@ -7,20 +7,20 @@ package com.example.inline_fragment_merge_fields.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.inline_fragment_merge_fields.type.Character; import com.example.inline_fragment_merge_fields.type.FriendsConnection; import com.example.inline_fragment_merge_fields.type.FriendsEdge; +import com.example.inline_fragment_merge_fields.type.GraphQLString; import com.example.inline_fragment_merge_fields.type.URL; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -32,7 +32,7 @@ public class TestQuerySelections { ); private static List node1 = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges1 = Arrays.asList( @@ -44,14 +44,14 @@ public class TestQuerySelections { ); private static List onCharacter = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("profileLink", new CompiledNotNullType(URL.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection1).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..d2b47037605 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..9e9d15469cb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLID.java.expected new file mode 100644 index 00000000000..ab933fda4b5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..46c1aed0a2a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLString.java.expected new file mode 100644 index 00000000000..64317ee6535 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/URL.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/URL.java.expected index 75d6a0e9de3..a79e39ddc52 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/URL.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/java/operationBased/inline_fragment_merge_fields/type/URL.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * URL for testing */ public class URL { - public static CustomScalarType type = new CustomScalarType("URL", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("URL", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected index f64f9c5e746..823680cf711 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.inline_fragment_merge_fields.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_merge_fields.type.Character import com.example.inline_fragment_merge_fields.type.FriendsConnection import com.example.inline_fragment_merge_fields.type.FriendsEdge +import com.example.inline_fragment_merge_fields.type.GraphQLString import com.example.inline_fragment_merge_fields.type.URL import kotlin.collections.List @@ -21,7 +21,7 @@ public object TestQuerySelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -44,7 +44,7 @@ public object TestQuerySelections { private val node1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -67,7 +67,7 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "profileLink", @@ -83,11 +83,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b3d54e46cd0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..4899bd85732 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..16dba3ca6f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..defdf277f55 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..81509104833 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/compat/inline_fragment_merge_fields/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected index f64f9c5e746..823680cf711 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.inline_fragment_merge_fields.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_merge_fields.type.Character import com.example.inline_fragment_merge_fields.type.FriendsConnection import com.example.inline_fragment_merge_fields.type.FriendsEdge +import com.example.inline_fragment_merge_fields.type.GraphQLString import com.example.inline_fragment_merge_fields.type.URL import kotlin.collections.List @@ -21,7 +21,7 @@ public object TestQuerySelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -44,7 +44,7 @@ public object TestQuerySelections { private val node1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -67,7 +67,7 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "profileLink", @@ -83,11 +83,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b3d54e46cd0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..4899bd85732 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..16dba3ca6f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..defdf277f55 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..81509104833 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/operationBased/inline_fragment_merge_fields/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected index f64f9c5e746..823680cf711 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.inline_fragment_merge_fields.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_merge_fields.type.Character import com.example.inline_fragment_merge_fields.type.FriendsConnection import com.example.inline_fragment_merge_fields.type.FriendsEdge +import com.example.inline_fragment_merge_fields.type.GraphQLString import com.example.inline_fragment_merge_fields.type.URL import kotlin.collections.List @@ -21,7 +21,7 @@ public object TestQuerySelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -44,7 +44,7 @@ public object TestQuerySelections { private val node1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -67,7 +67,7 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "profileLink", @@ -83,11 +83,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b3d54e46cd0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..4899bd85732 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..16dba3ca6f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..defdf277f55 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..81509104833 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_merge_fields/kotlin/responseBased/inline_fragment_merge_fields/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_merge_fields.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.java.expected index 7d5a915711e..7e3a7ef81aa 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.java.expected @@ -7,21 +7,21 @@ package com.example.inline_fragment_type_coercion.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.inline_fragment_type_coercion.type.Foo; +import com.example.inline_fragment_type_coercion.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onBar = Arrays.asList( - new CompiledField.Builder("bar", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("bar", new CompiledNotNullType(GraphQLString.type)).build() ); private static List foo = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("foo", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("foo", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Bar", Arrays.asList("BarObject", "FooBar")).selections(onBar).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..c3b497650d7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..53237c0806e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLID.java.expected new file mode 100644 index 00000000000..3ef9f48dc9d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..efc2dfc6f51 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLString.java.expected new file mode 100644 index 00000000000..50a56ee5f99 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/java/operationBased/inline_fragment_type_coercion/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected index 6840af82eea..aebe6513380 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.inline_fragment_type_coercion.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_type_coercion.type.Foo +import com.example.inline_fragment_type_coercion.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onBar: List = listOf( CompiledField.Builder( name = "bar", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val foo: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "foo", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Bar", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..fd5555235f0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..e88aa047bf7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..295cf1019b5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f1b96d6b859 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..88d8d67a597 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/compat/inline_fragment_type_coercion/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected index 6840af82eea..aebe6513380 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.inline_fragment_type_coercion.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_type_coercion.type.Foo +import com.example.inline_fragment_type_coercion.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onBar: List = listOf( CompiledField.Builder( name = "bar", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val foo: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "foo", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Bar", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..fd5555235f0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..e88aa047bf7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..295cf1019b5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f1b96d6b859 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..88d8d67a597 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/operationBased/inline_fragment_type_coercion/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected index 6840af82eea..aebe6513380 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.inline_fragment_type_coercion.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_type_coercion.type.Foo +import com.example.inline_fragment_type_coercion.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onBar: List = listOf( CompiledField.Builder( name = "bar", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val foo: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "foo", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Bar", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..fd5555235f0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..e88aa047bf7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..295cf1019b5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f1b96d6b859 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..88d8d67a597 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_type_coercion/kotlin/responseBased/inline_fragment_type_coercion/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_type_coercion.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.java.expected index 99dddbb3222..6206d26771e 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.java.expected @@ -8,31 +8,32 @@ package com.example.inline_fragment_with_include_directive.selections; import com.apollographql.apollo3.api.CompiledCondition; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.inline_fragment_with_include_directive.type.Character; +import com.example.inline_fragment_with_include_directive.type.GraphQLID; +import com.example.inline_fragment_with_include_directive.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onHuman = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("homePlanet", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("homePlanet", GraphQLString.type).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List onCharacter = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).condition(Arrays.asList(new CompiledCondition("withDetails", false), new CompiledCondition("skipHumanDetails", true))).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).condition(Arrays.asList(new CompiledCondition("withDetails", false))).selections(onDroid).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).condition(Arrays.asList(new CompiledCondition("withDetails", false))).selections(onCharacter).build() diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..0974bdf5703 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..98bb2804998 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLID.java.expected new file mode 100644 index 00000000000..2b6a16c9bee --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..5a4b728253c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLString.java.expected new file mode 100644 index 00000000000..64dbbf2a454 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/java/operationBased/inline_fragment_with_include_directive/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected index 820279c8eeb..e982e13751d 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected @@ -8,51 +8,51 @@ package com.example.inline_fragment_with_include_directive.selections import com.apollographql.apollo3.api.CompiledCondition import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_with_include_directive.type.Character +import com.example.inline_fragment_with_include_directive.type.GraphQLID +import com.example.inline_fragment_with_include_directive.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ec046e6d90e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..f0db3c55294 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..547eb28f4da --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..642cd2119b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..72202daea7c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/compat/inline_fragment_with_include_directive/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected index 820279c8eeb..e982e13751d 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/selections/TestQuerySelections.kt.expected @@ -8,51 +8,51 @@ package com.example.inline_fragment_with_include_directive.selections import com.apollographql.apollo3.api.CompiledCondition import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.inline_fragment_with_include_directive.type.Character +import com.example.inline_fragment_with_include_directive.type.GraphQLID +import com.example.inline_fragment_with_include_directive.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ec046e6d90e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..f0db3c55294 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..547eb28f4da --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..642cd2119b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..72202daea7c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragment_with_include_directive/kotlin/operationBased/inline_fragment_with_include_directive/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragment_with_include_directive.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.java.expected index b22e5b89a67..695ed5a6103 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.java.expected @@ -7,12 +7,14 @@ package com.example.inline_fragments_with_friends.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.inline_fragments_with_friends.type.Character; import com.example.inline_fragments_with_friends.type.Episode; +import com.example.inline_fragments_with_friends.type.GraphQLFloat; +import com.example.inline_fragments_with_friends.type.GraphQLID; +import com.example.inline_fragments_with_friends.type.GraphQLString; import java.util.Arrays; import java.util.List; @@ -22,22 +24,22 @@ public class TestQuerySelections { ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build(), + new CompiledField.Builder("height", GraphQLFloat.type).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends).build() ); private static List friends1 = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends1).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..d6e0465a143 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..d7c9758e4ae --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLID.java.expected new file mode 100644 index 00000000000..ecdaeba8c66 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..d5b08504725 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLString.java.expected new file mode 100644 index 00000000000..7237c468132 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/java/operationBased/inline_fragments_with_friends/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected index 410173f1293..ea94dac0266 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected @@ -6,15 +6,15 @@ package com.example.inline_fragments_with_friends.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragments_with_friends.type.Character import com.example.inline_fragments_with_friends.type.Episode +import com.example.inline_fragments_with_friends.type.GraphQLFloat +import com.example.inline_fragments_with_friends.type.GraphQLID +import com.example.inline_fragments_with_friends.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { @@ -28,7 +28,7 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "friends", @@ -40,14 +40,14 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -59,11 +59,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ae0124b10f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a4d4b3160e1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9fcb63aadab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..20028e00407 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..bfb25454bd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/compat/inline_fragments_with_friends/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected index 410173f1293..ea94dac0266 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected @@ -6,15 +6,15 @@ package com.example.inline_fragments_with_friends.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragments_with_friends.type.Character import com.example.inline_fragments_with_friends.type.Episode +import com.example.inline_fragments_with_friends.type.GraphQLFloat +import com.example.inline_fragments_with_friends.type.GraphQLID +import com.example.inline_fragments_with_friends.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { @@ -28,7 +28,7 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "friends", @@ -40,14 +40,14 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -59,11 +59,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ae0124b10f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a4d4b3160e1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9fcb63aadab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..20028e00407 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..bfb25454bd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/operationBased/inline_fragments_with_friends/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected index 410173f1293..ea94dac0266 100644 --- a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/selections/TestQuerySelections.kt.expected @@ -6,15 +6,15 @@ package com.example.inline_fragments_with_friends.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.inline_fragments_with_friends.type.Character import com.example.inline_fragments_with_friends.type.Episode +import com.example.inline_fragments_with_friends.type.GraphQLFloat +import com.example.inline_fragments_with_friends.type.GraphQLID +import com.example.inline_fragments_with_friends.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { @@ -28,7 +28,7 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "friends", @@ -40,14 +40,14 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -59,11 +59,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ae0124b10f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a4d4b3160e1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9fcb63aadab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..20028e00407 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..bfb25454bd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/inline_fragments_with_friends/kotlin/responseBased/inline_fragments_with_friends/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.inline_fragments_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/adapter/TestQuery_ResponseAdapter.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/adapter/TestQuery_ResponseAdapter.java.expected index 020239477e1..d7f6d667bc1 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/adapter/TestQuery_ResponseAdapter.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/adapter/TestQuery_ResponseAdapter.java.expected @@ -68,7 +68,7 @@ public class TestQuery_ResponseAdapter { while(true) { switch (reader.selectName(RESPONSE_NAMES)) { case 0: stars = Adapters.IntAdapter.fromJson(reader, customScalarAdapters); break; - case 1: commentary = Adapters.NullableStringAdapter.fromJson(reader, customScalarAdapters); break; + case 1: commentary = new NullableAdapter<>(new com.example.MyStringAdapter()).fromJson(reader, customScalarAdapters); break; default: break loop; } } @@ -88,7 +88,7 @@ public class TestQuery_ResponseAdapter { Adapters.IntAdapter.toJson(writer, customScalarAdapters, value.stars); writer.name("commentary"); - Adapters.NullableStringAdapter.toJson(writer, customScalarAdapters, value.commentary); + new NullableAdapter<>(new com.example.MyStringAdapter()).toJson(writer, customScalarAdapters, value.commentary); } } } diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/selections/TestQuerySelections.java.expected index fee1518ae2b..57a493bf150 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/selections/TestQuerySelections.java.expected @@ -7,18 +7,19 @@ package com.example.input_object_type.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.input_object_type.type.GraphQLInt; +import com.example.input_object_type.type.GraphQLString; import com.example.input_object_type.type.Review; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List createReview = Arrays.asList( - new CompiledField.Builder("stars", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).build(), - new CompiledField.Builder("commentary", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("stars", new CompiledNotNullType(GraphQLInt.type)).build(), + new CompiledField.Builder("commentary", GraphQLString.type).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..03808c228ce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..e6247cfe632 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLID.java.expected new file mode 100644 index 00000000000..1056fc7d480 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.Long"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..cb956c7374c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLString.java.expected new file mode 100644 index 00000000000..768cf1cd7c0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/adapter/ReviewInput_InputAdapter.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/adapter/ReviewInput_InputAdapter.java.expected index 85e69d51cc3..4a2e8a80619 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/adapter/ReviewInput_InputAdapter.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/java/operationBased/input_object_type/type/adapter/ReviewInput_InputAdapter.java.expected @@ -47,7 +47,7 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.commentary instanceof Optional.Present) { writer.name("commentary"); - new OptionalAdapter<>(Adapters.NullableStringAdapter).toJson(writer, customScalarAdapters, (Optional.Present)value.commentary); + new OptionalAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())).toJson(writer, customScalarAdapters, (Optional.Present)value.commentary); } writer.name("favoriteColor"); new ObjectAdapter(ColorInput_InputAdapter.INSTANCE, false).toJson(writer, customScalarAdapters, value.favoriteColor); @@ -81,10 +81,10 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.listOfString instanceof Optional.Present) { writer.name("listOfString"); - new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(Adapters.NullableStringAdapter))).toJson(writer, customScalarAdapters, (Optional.Present>)value.listOfString); + new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())))).toJson(writer, customScalarAdapters, (Optional.Present>)value.listOfString); } writer.name("listOfStringNonOptional"); - new ListAdapter<>(Adapters.NullableStringAdapter).toJson(writer, customScalarAdapters, value.listOfStringNonOptional); + new ListAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())).toJson(writer, customScalarAdapters, value.listOfStringNonOptional); if (value.listOfInputTypes instanceof Optional.Present) { writer.name("listOfInputTypes"); new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new NullableAdapter<>(new ObjectAdapter(ColorInput_InputAdapter.INSTANCE, false))))).toJson(writer, customScalarAdapters, (Optional.Present>)value.listOfInputTypes); @@ -99,7 +99,7 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.listOfListOfString instanceof Optional.Present) { writer.name("listOfListOfString"); - new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(Adapters.StringAdapter)))).toJson(writer, customScalarAdapters, (Optional.Present>>)value.listOfListOfString); + new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(new com.example.MyStringAdapter())))).toJson(writer, customScalarAdapters, (Optional.Present>>)value.listOfListOfString); } if (value.listOfListOfEnum instanceof Optional.Present) { writer.name("listOfListOfEnum"); @@ -115,7 +115,7 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.CapitalizedField instanceof Optional.Present) { writer.name("CapitalizedField"); - new OptionalAdapter<>(Adapters.NullableStringAdapter).toJson(writer, customScalarAdapters, (Optional.Present)value.CapitalizedField); + new OptionalAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())).toJson(writer, customScalarAdapters, (Optional.Present)value.CapitalizedField); } if (value.CapitalizedInt instanceof Optional.Present) { writer.name("CapitalizedInt"); diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/TestQuery.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/TestQuery.kt.expected index 0c7768fee0d..d41425658b9 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/TestQuery.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/TestQuery.kt.expected @@ -57,7 +57,7 @@ public data class TestQuery( /** * Comment about the movie */ - public val commentary: String? + public val commentary: java.lang.String? ) } diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/adapter/TestQuery_ResponseAdapter.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/adapter/TestQuery_ResponseAdapter.kt.expected index dc4e4300719..ca3299c03fd 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/adapter/TestQuery_ResponseAdapter.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/adapter/TestQuery_ResponseAdapter.kt.expected @@ -8,7 +8,6 @@ package com.example.input_object_type.adapter import com.apollographql.apollo3.api.Adapter import com.apollographql.apollo3.api.CustomScalarAdapters import com.apollographql.apollo3.api.IntAdapter -import com.apollographql.apollo3.api.NullableStringAdapter import com.apollographql.apollo3.api.json.JsonReader import com.apollographql.apollo3.api.json.JsonWriter import com.apollographql.apollo3.api.nullable @@ -54,12 +53,13 @@ public object TestQuery_ResponseAdapter { public override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): TestQuery.Data.CreateReview { var stars: Int? = null - var commentary: String? = null + var commentary: java.lang.String? = null while(true) { when (reader.selectName(RESPONSE_NAMES)) { 0 -> stars = IntAdapter.fromJson(reader, customScalarAdapters) - 1 -> commentary = NullableStringAdapter.fromJson(reader, customScalarAdapters) + 1 -> commentary = com.example.MyStringAdapter().nullable().fromJson(reader, + customScalarAdapters) else -> break } } @@ -79,7 +79,8 @@ public object TestQuery_ResponseAdapter { IntAdapter.toJson(writer, customScalarAdapters, value.stars) writer.name("commentary") - NullableStringAdapter.toJson(writer, customScalarAdapters, value.commentary) + com.example.MyStringAdapter().nullable().toJson(writer, customScalarAdapters, + value.commentary) } } } diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/selections/TestQuerySelections.kt.expected index bdc79b4c519..dfd801174d5 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/selections/TestQuerySelections.kt.expected @@ -7,11 +7,11 @@ package com.example.input_object_type.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.input_object_type.type.GraphQLInt +import com.example.input_object_type.type.GraphQLString import com.example.input_object_type.type.Review import kotlin.collections.List @@ -19,11 +19,11 @@ public object TestQuerySelections { private val createReview: List = listOf( CompiledField.Builder( name = "stars", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).build(), CompiledField.Builder( name = "commentary", - type = CompiledStringType + type = GraphQLString.type ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4c070eb0921 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..44a6f999f01 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..ff6a61503ee --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "java.lang.Long") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..7d90d39e782 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..509062ac5a1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_type.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "java.lang.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/ReviewInput.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/ReviewInput.kt.expected index e2f1d58a3b9..ee52ee242e5 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/ReviewInput.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/ReviewInput.kt.expected @@ -6,10 +6,10 @@ package com.example.input_object_type.type import com.apollographql.apollo3.api.Optional +import java.lang.String import java.util.Date import kotlin.Boolean import kotlin.Int -import kotlin.String import kotlin.collections.List /** diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/adapter/ReviewInput_InputAdapter.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/adapter/ReviewInput_InputAdapter.kt.expected index b77bd306c18..2df79ed7a02 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/adapter/ReviewInput_InputAdapter.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_type/kotlin/responseBased/input_object_type/type/adapter/ReviewInput_InputAdapter.kt.expected @@ -10,9 +10,7 @@ import com.apollographql.apollo3.api.CustomScalarAdapters import com.apollographql.apollo3.api.IntAdapter import com.apollographql.apollo3.api.NullableBooleanAdapter import com.apollographql.apollo3.api.NullableIntAdapter -import com.apollographql.apollo3.api.NullableStringAdapter import com.apollographql.apollo3.api.Optional -import com.apollographql.apollo3.api.StringAdapter import com.apollographql.apollo3.api.json.JsonReader import com.apollographql.apollo3.api.json.JsonWriter import com.apollographql.apollo3.api.list @@ -42,7 +40,8 @@ public object ReviewInput_InputAdapter : Adapter { } if (value.commentary is Optional.Present) { writer.name("commentary") - NullableStringAdapter.optional().toJson(writer, customScalarAdapters, value.commentary) + com.example.MyStringAdapter().nullable().optional().toJson(writer, customScalarAdapters, + value.commentary) } writer.name("favoriteColor") ColorInput_InputAdapter.obj().toJson(writer, customScalarAdapters, value.favoriteColor) @@ -83,11 +82,12 @@ public object ReviewInput_InputAdapter : Adapter { } if (value.listOfString is Optional.Present) { writer.name("listOfString") - NullableStringAdapter.list().nullable().optional().toJson(writer, customScalarAdapters, - value.listOfString) + com.example.MyStringAdapter().nullable().list().nullable().optional().toJson(writer, + customScalarAdapters, value.listOfString) } writer.name("listOfStringNonOptional") - NullableStringAdapter.list().toJson(writer, customScalarAdapters, value.listOfStringNonOptional) + com.example.MyStringAdapter().nullable().list().toJson(writer, customScalarAdapters, + value.listOfStringNonOptional) if (value.listOfInputTypes is Optional.Present) { writer.name("listOfInputTypes") ColorInput_InputAdapter.obj().nullable().list().nullable().optional().toJson(writer, @@ -105,8 +105,8 @@ public object ReviewInput_InputAdapter : Adapter { } if (value.listOfListOfString is Optional.Present) { writer.name("listOfListOfString") - StringAdapter.list().list().nullable().optional().toJson(writer, customScalarAdapters, - value.listOfListOfString) + com.example.MyStringAdapter().list().list().nullable().optional().toJson(writer, + customScalarAdapters, value.listOfListOfString) } if (value.listOfListOfEnum is Optional.Present) { writer.name("listOfListOfEnum") @@ -125,7 +125,8 @@ public object ReviewInput_InputAdapter : Adapter { } if (value.CapitalizedField is Optional.Present) { writer.name("CapitalizedField") - NullableStringAdapter.optional().toJson(writer, customScalarAdapters, value.CapitalizedField) + com.example.MyStringAdapter().nullable().optional().toJson(writer, customScalarAdapters, + value.CapitalizedField) } if (value.CapitalizedInt is Optional.Present) { writer.name("CapitalizedInt") diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/selections/TestQuerySelections.java.expected index 4e364296253..b202933ddde 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/selections/TestQuerySelections.java.expected @@ -7,11 +7,12 @@ package com.example.input_object_variable_and_argument.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.apollographql.apollo3.api.ImmutableMapBuilder; +import com.example.input_object_variable_and_argument.type.GraphQLFloat; +import com.example.input_object_variable_and_argument.type.GraphQLString; import com.example.input_object_variable_and_argument.type.Human; import java.util.Arrays; import java.util.Collections; @@ -19,8 +20,8 @@ import java.util.List; public class TestQuerySelections { private static List heroWithReview = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).arguments(Arrays.asList(new CompiledArgument("unit", "FOOT", false))).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("height", GraphQLFloat.type).arguments(Arrays.asList(new CompiledArgument("unit", "FOOT", false))).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..037a8e507c0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..bc67a2844f5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLID.java.expected new file mode 100644 index 00000000000..d6fc3610452 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..c610ac64317 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLString.java.expected new file mode 100644 index 00000000000..8405126b11f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/java/operationBased/input_object_variable_and_argument/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/selections/TestQuerySelections.kt.expected index 212aa0ec927..32fcbce80ac 100644 --- a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/selections/TestQuerySelections.kt.expected @@ -7,11 +7,11 @@ package com.example.input_object_variable_and_argument.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.input_object_variable_and_argument.type.GraphQLFloat +import com.example.input_object_variable_and_argument.type.GraphQLString import com.example.input_object_variable_and_argument.type.Human import kotlin.collections.List @@ -19,11 +19,11 @@ public object TestQuerySelections { private val heroWithReview: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "FOOT") )) diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c799b0d9da4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..a2b74681998 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..99e514dfb6d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..8655e44ccf1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..ed864c0e470 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/input_object_variable_and_argument/kotlin/responseBased/input_object_variable_and_argument/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.input_object_variable_and_argument.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/selections/TestQuerySelections.java.expected index 7c7f2bbac60..f58cd9c6573 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/selections/TestQuerySelections.java.expected @@ -7,26 +7,26 @@ package com.example.interface_always_nested.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.interface_always_nested.type.C; +import com.example.interface_always_nested.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onB = Arrays.asList( - new CompiledField.Builder("fieldB1", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldB1", GraphQLString.type).build() ); private static List onA = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("fieldA1", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("fieldA1", GraphQLString.type).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "BC")).selections(onB).build() ); private static List root1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("A", Arrays.asList("ABC", "AC")).selections(onA).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..8cccf468a6a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..850b2af8348 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLID.java.expected new file mode 100644 index 00000000000..e36f4f24b98 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..cef326336d3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLString.java.expected new file mode 100644 index 00000000000..61646e37d66 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/java/operationBased/interface_always_nested/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/selections/TestQuerySelections.kt.expected index 3ee1d355c2a..deeca2f5707 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.interface_always_nested.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.interface_always_nested.type.C +import com.example.interface_always_nested.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -40,7 +40,7 @@ public object TestQuerySelections { private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e42f411c9bc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..b83ceabc017 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8e0afcb0e39 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..dae73d91141 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..38c32868b67 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/compat/interface_always_nested/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/selections/TestQuerySelections.kt.expected index 3ee1d355c2a..deeca2f5707 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.interface_always_nested.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.interface_always_nested.type.C +import com.example.interface_always_nested.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -40,7 +40,7 @@ public object TestQuerySelections { private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e42f411c9bc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..b83ceabc017 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8e0afcb0e39 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..dae73d91141 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..38c32868b67 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/operationBased/interface_always_nested/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/selections/TestQuerySelections.kt.expected index 3ee1d355c2a..deeca2f5707 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/selections/TestQuerySelections.kt.expected @@ -8,27 +8,27 @@ package com.example.interface_always_nested.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.interface_always_nested.type.C +import com.example.interface_always_nested.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -40,7 +40,7 @@ public object TestQuerySelections { private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e42f411c9bc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..b83ceabc017 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8e0afcb0e39 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..dae73d91141 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..38c32868b67 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_always_nested/kotlin/responseBased/interface_always_nested/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_always_nested.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/selections/GetHumanSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/selections/GetHumanSelections.java.expected index 5968dc37ac7..f826d847034 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/selections/GetHumanSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/selections/GetHumanSelections.java.expected @@ -7,9 +7,11 @@ package com.example.interface_on_interface.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.interface_on_interface.type.GraphQLFloat; +import com.example.interface_on_interface.type.GraphQLID; +import com.example.interface_on_interface.type.GraphQLString; import com.example.interface_on_interface.type.Human; import com.example.interface_on_interface.type.Node; import java.util.Arrays; @@ -17,17 +19,17 @@ import java.util.List; public class GetHumanSelections { private static List human = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("height", new CompiledNotNullType(CompiledGraphQL.CompiledFloatType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("height", new CompiledNotNullType(GraphQLFloat.type)).build() ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", new CompiledNotNullType(CompiledGraphQL.CompiledFloatType)).build() + new CompiledField.Builder("height", new CompiledNotNullType(GraphQLFloat.type)).build() ); private static List node = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..3d789f578d1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..76472903a4b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLID.java.expected new file mode 100644 index 00000000000..68c46fd811d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..ec2d96a0088 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLString.java.expected new file mode 100644 index 00000000000..58d3d2b39ef --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/java/operationBased/interface_on_interface/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/selections/GetHumanSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/selections/GetHumanSelections.kt.expected index f5a7a07fbed..e80ea3262fe 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/selections/GetHumanSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/selections/GetHumanSelections.kt.expected @@ -6,12 +6,12 @@ package com.example.interface_on_interface.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.interface_on_interface.type.GraphQLFloat +import com.example.interface_on_interface.type.GraphQLID +import com.example.interface_on_interface.type.GraphQLString import com.example.interface_on_interface.type.Human import com.example.interface_on_interface.type.Node import kotlin.collections.List @@ -20,29 +20,29 @@ public object GetHumanSelections { private val human: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType.notNull() + type = GraphQLFloat.type.notNull() ).build() ) private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType.notNull() + type = GraphQLFloat.type.notNull() ).build() ) private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..591a86d5a1b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fa4f2d202d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f3bc853886d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..6f6a7eb40f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..bd22edfc608 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/compat/interface_on_interface/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/selections/GetHumanSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/selections/GetHumanSelections.kt.expected index f5a7a07fbed..e80ea3262fe 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/selections/GetHumanSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/selections/GetHumanSelections.kt.expected @@ -6,12 +6,12 @@ package com.example.interface_on_interface.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.interface_on_interface.type.GraphQLFloat +import com.example.interface_on_interface.type.GraphQLID +import com.example.interface_on_interface.type.GraphQLString import com.example.interface_on_interface.type.Human import com.example.interface_on_interface.type.Node import kotlin.collections.List @@ -20,29 +20,29 @@ public object GetHumanSelections { private val human: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType.notNull() + type = GraphQLFloat.type.notNull() ).build() ) private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType.notNull() + type = GraphQLFloat.type.notNull() ).build() ) private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..591a86d5a1b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fa4f2d202d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f3bc853886d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..6f6a7eb40f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..bd22edfc608 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/operationBased/interface_on_interface/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/selections/GetHumanSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/selections/GetHumanSelections.kt.expected index f5a7a07fbed..e80ea3262fe 100644 --- a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/selections/GetHumanSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/selections/GetHumanSelections.kt.expected @@ -6,12 +6,12 @@ package com.example.interface_on_interface.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.interface_on_interface.type.GraphQLFloat +import com.example.interface_on_interface.type.GraphQLID +import com.example.interface_on_interface.type.GraphQLString import com.example.interface_on_interface.type.Human import com.example.interface_on_interface.type.Node import kotlin.collections.List @@ -20,29 +20,29 @@ public object GetHumanSelections { private val human: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "height", - type = CompiledFloatType.notNull() + type = GraphQLFloat.type.notNull() ).build() ) private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType.notNull() + type = GraphQLFloat.type.notNull() ).build() ) private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..591a86d5a1b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fa4f2d202d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f3bc853886d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..6f6a7eb40f9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..bd22edfc608 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/interface_on_interface/kotlin/responseBased/interface_on_interface/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.interface_on_interface.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/selections/TestQuerySelections.java.expected index 4c74ff10e87..7fb0f1db64c 100644 --- a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/selections/TestQuerySelections.java.expected @@ -11,16 +11,17 @@ import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.introspection_query.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List queryType = Arrays.asList( - new CompiledField.Builder("name", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", GraphQLString.type).build() ); private static List types = Arrays.asList( - new CompiledField.Builder("name", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", GraphQLString.type).build() ); private static List __schema = Arrays.asList( @@ -29,7 +30,7 @@ public class TestQuerySelections { ); private static List __type = Arrays.asList( - new CompiledField.Builder("name", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", GraphQLString.type).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..74192e8b396 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..97623904686 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLID.java.expected new file mode 100644 index 00000000000..c0668a5a586 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..eac7ee24fca --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLString.java.expected new file mode 100644 index 00000000000..d09bf6f986d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/java/operationBased/introspection_query/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/selections/TestQuerySelections.kt.expected index f88239840ce..203897bbea0 100644 --- a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/selections/TestQuerySelections.kt.expected @@ -9,24 +9,24 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSchemaType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledTypeType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.introspection_query.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val queryType: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val types: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build() ) @@ -46,7 +46,7 @@ public object TestQuerySelections { private val __type: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..10fc0016d00 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..7d4f40efc31 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8d8e0f21bc3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..78b1480b0d7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..2cc5d1d5b80 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/introspection_query/kotlin/responseBased/introspection_query/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.introspection_query.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/selections/LoginBarberSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/selections/LoginBarberSelections.java.expected index d02c515e50a..a2603c76fb2 100644 --- a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/selections/LoginBarberSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/selections/LoginBarberSelections.java.expected @@ -7,17 +7,17 @@ package com.example.java8annotation.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.java8annotation.type.GraphQLString; import com.example.java8annotation.type.User; import java.util.Arrays; import java.util.List; public class LoginBarberSelections { private static List login = Arrays.asList( - new CompiledField.Builder("response", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("response", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..962ca4468fa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..486f9cb7b88 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLID.java.expected new file mode 100644 index 00000000000..5b102c846f8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..2fe26cf4c69 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLString.java.expected new file mode 100644 index 00000000000..38126d656ee --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/java/operationBased/java8annotation/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/selections/LoginBarberSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/selections/LoginBarberSelections.kt.expected index eb6cee11b1c..2f6ad526207 100644 --- a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/selections/LoginBarberSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/selections/LoginBarberSelections.kt.expected @@ -8,9 +8,9 @@ package com.example.java8annotation.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.java8annotation.type.GraphQLString import com.example.java8annotation.type.User import kotlin.collections.List @@ -18,7 +18,7 @@ public object LoginBarberSelections { private val login: List = listOf( CompiledField.Builder( name = "response", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c54611065b9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..bb83302d794 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3aea49b0156 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..a51b92a1f58 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..ad5f6071d79 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/java8annotation/kotlin/responseBased/java8annotation/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.java8annotation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/selections/TestQuerySelections.java.expected index fe74ec6d4db..da38be425f0 100644 --- a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/selections/TestQuerySelections.java.expected @@ -6,16 +6,16 @@ package com.example.merged_include.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.merged_include.type.Character; +import com.example.merged_include.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..dac2f5e3227 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..89f198ef58b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLID.java.expected new file mode 100644 index 00000000000..492a3fb3771 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..bee964aec37 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLString.java.expected new file mode 100644 index 00000000000..cda38277840 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/java/operationBased/merged_include/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/selections/TestQuerySelections.kt.expected index 0c2ea5b4ea3..6c50b8f93b8 100644 --- a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/selections/TestQuerySelections.kt.expected @@ -7,16 +7,16 @@ package com.example.merged_include.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.merged_include.type.Character +import com.example.merged_include.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..37b4f621936 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..bd0fd9068c0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..0ef3e06acf6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..4083aa36685 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f3ee3fd5bec --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/merged_include/kotlin/responseBased/merged_include/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.merged_include.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.java.expected index 391a861bda4..1d0c349a7df 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.java.expected @@ -7,16 +7,16 @@ package com.example.multiple_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.multiple_fragments.type.GraphQLString; import com.example.multiple_fragments.type.Node; import java.util.Arrays; import java.util.List; public class aFragmentSelections { private static List node = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("ANode", Arrays.asList("ANode")).selections(fragment1Selections.root).build(), new CompiledFragment.Builder("ANode", Arrays.asList("ANode")).selections(fragment2Selections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment1Selections.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment1Selections.java.expected index 75f1dce2196..34a2b87e9b2 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment1Selections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment1Selections.java.expected @@ -6,13 +6,13 @@ package com.example.multiple_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.multiple_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class fragment1Selections { public static List root = Arrays.asList( - new CompiledField.Builder("field1", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("field1", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment2Selections.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment2Selections.java.expected index f0b016a280b..53069f2d189 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment2Selections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/fragment/selections/fragment2Selections.java.expected @@ -6,13 +6,13 @@ package com.example.multiple_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.multiple_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class fragment2Selections { public static List root = Arrays.asList( - new CompiledField.Builder("field2", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("field2", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/selections/TestQuerySelections.java.expected index 040573d1d2c..97a59ea6aee 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/selections/TestQuerySelections.java.expected @@ -7,17 +7,17 @@ package com.example.multiple_fragments.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.multiple_fragments.fragment.selections.aFragmentSelections; import com.example.multiple_fragments.type.A; +import com.example.multiple_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List a = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("A", Arrays.asList("A")).selections(aFragmentSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..36f66c54d8b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..70f054d2d29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLID.java.expected new file mode 100644 index 00000000000..67e676488ef --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..fca8d581b1c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLString.java.expected new file mode 100644 index 00000000000..b2b9da1e078 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/java/operationBased/multiple_fragments/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected index 48868a46cd7..e7c03426bb2 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected @@ -8,8 +8,8 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.multiple_fragments.type.GraphQLString import com.example.multiple_fragments.type.Node import kotlin.collections.List @@ -17,7 +17,7 @@ public object aFragmentSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "ANode", diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment1Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment1Selections.kt.expected index 62b15c3e198..2545c244a6a 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment1Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment1Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object fragment1Selections { public val root: List = listOf( CompiledField.Builder( name = "field1", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment2Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment2Selections.kt.expected index 1ebf09ac6e2..3cd67505c03 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment2Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/fragment/selections/fragment2Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object fragment2Selections { public val root: List = listOf( CompiledField.Builder( name = "field2", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/selections/TestQuerySelections.kt.expected index 29502cfbd13..8955678a0b5 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.multiple_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.multiple_fragments.fragment.selections.aFragmentSelections import com.example.multiple_fragments.type.A +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val a: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f17d7f72406 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..804216f9fb3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..fd77a2fd9d9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..9cae949f0d7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..86e94b67781 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/compat/multiple_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected index 48868a46cd7..e7c03426bb2 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected @@ -8,8 +8,8 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.multiple_fragments.type.GraphQLString import com.example.multiple_fragments.type.Node import kotlin.collections.List @@ -17,7 +17,7 @@ public object aFragmentSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "ANode", diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected index 62b15c3e198..2545c244a6a 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object fragment1Selections { public val root: List = listOf( CompiledField.Builder( name = "field1", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected index 1ebf09ac6e2..3cd67505c03 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object fragment2Selections { public val root: List = listOf( CompiledField.Builder( name = "field2", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/selections/TestQuerySelections.kt.expected index 29502cfbd13..8955678a0b5 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.multiple_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.multiple_fragments.fragment.selections.aFragmentSelections import com.example.multiple_fragments.type.A +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val a: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f17d7f72406 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..804216f9fb3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..fd77a2fd9d9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..9cae949f0d7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..86e94b67781 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/operationBased/multiple_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected index 48868a46cd7..e7c03426bb2 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/aFragmentSelections.kt.expected @@ -8,8 +8,8 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.multiple_fragments.type.GraphQLString import com.example.multiple_fragments.type.Node import kotlin.collections.List @@ -17,7 +17,7 @@ public object aFragmentSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "ANode", diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected index 62b15c3e198..2545c244a6a 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment1Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object fragment1Selections { public val root: List = listOf( CompiledField.Builder( name = "field1", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected index 1ebf09ac6e2..3cd67505c03 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/fragment/selections/fragment2Selections.kt.expected @@ -7,14 +7,14 @@ package com.example.multiple_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object fragment2Selections { public val root: List = listOf( CompiledField.Builder( name = "field2", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/selections/TestQuerySelections.kt.expected index 29502cfbd13..8955678a0b5 100644 --- a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.multiple_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.multiple_fragments.fragment.selections.aFragmentSelections import com.example.multiple_fragments.type.A +import com.example.multiple_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val a: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f17d7f72406 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..804216f9fb3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..fd77a2fd9d9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..9cae949f0d7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..86e94b67781 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/multiple_fragments/kotlin/responseBased/multiple_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.multiple_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.java.expected index 3a3c70c1100..5d7793faf4c 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.java.expected @@ -76,8 +76,8 @@ public class CreateReviewForEpisode_ResponseAdapter { while(true) { switch (reader.selectName(RESPONSE_NAMES)) { case 0: stars = Adapters.IntAdapter.fromJson(reader, customScalarAdapters); break; - case 1: commentary = Adapters.NullableStringAdapter.fromJson(reader, customScalarAdapters); break; - case 2: listOfListOfString = new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(Adapters.StringAdapter))).fromJson(reader, customScalarAdapters); break; + case 1: commentary = new NullableAdapter<>(new com.example.MyStringAdapter()).fromJson(reader, customScalarAdapters); break; + case 2: listOfListOfString = new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(new com.example.MyStringAdapter()))).fromJson(reader, customScalarAdapters); break; case 3: listOfListOfEnum = new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(Episode_ResponseAdapter.INSTANCE))).fromJson(reader, customScalarAdapters); break; case 4: listOfListOfCustom = new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>((customScalarAdapters.responseAdapterFor(com.example.mutation_create_review.type.Date.type))))).fromJson(reader, customScalarAdapters); break; case 5: listOfListOfObject = new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(new ObjectAdapter(ListOfListOfObject.INSTANCE, false)))).fromJson(reader, customScalarAdapters); break; @@ -104,10 +104,10 @@ public class CreateReviewForEpisode_ResponseAdapter { Adapters.IntAdapter.toJson(writer, customScalarAdapters, value.stars); writer.name("commentary"); - Adapters.NullableStringAdapter.toJson(writer, customScalarAdapters, value.commentary); + new NullableAdapter<>(new com.example.MyStringAdapter()).toJson(writer, customScalarAdapters, value.commentary); writer.name("listOfListOfString"); - new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(Adapters.StringAdapter))).toJson(writer, customScalarAdapters, value.listOfListOfString); + new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(new com.example.MyStringAdapter()))).toJson(writer, customScalarAdapters, value.listOfListOfString); writer.name("listOfListOfEnum"); new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(Episode_ResponseAdapter.INSTANCE))).toJson(writer, customScalarAdapters, value.listOfListOfEnum); @@ -133,7 +133,7 @@ public class CreateReviewForEpisode_ResponseAdapter { loop: while(true) { switch (reader.selectName(RESPONSE_NAMES)) { - case 0: name = Adapters.StringAdapter.fromJson(reader, customScalarAdapters); break; + case 0: name = new com.example.MyStringAdapter().fromJson(reader, customScalarAdapters); break; default: break loop; } } @@ -149,7 +149,7 @@ public class CreateReviewForEpisode_ResponseAdapter { public void toJson(JsonWriter writer, CustomScalarAdapters customScalarAdapters, CreateReviewForEpisode.ListOfListOfObject value) throws IOException { writer.name("name"); - Adapters.StringAdapter.toJson(writer, customScalarAdapters, value.name); + new com.example.MyStringAdapter().toJson(writer, customScalarAdapters, value.name); } } } diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.java.expected index dc8c763f8ec..052f6237664 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.java.expected @@ -7,7 +7,6 @@ package com.example.mutation_create_review.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; @@ -15,19 +14,21 @@ import com.apollographql.apollo3.api.CompiledVariable; import com.example.mutation_create_review.type.Character; import com.example.mutation_create_review.type.Date; import com.example.mutation_create_review.type.Episode; +import com.example.mutation_create_review.type.GraphQLInt; +import com.example.mutation_create_review.type.GraphQLString; import com.example.mutation_create_review.type.Review; import java.util.Arrays; import java.util.List; public class CreateReviewForEpisodeSelections { private static List listOfListOfObject = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List createReview = Arrays.asList( - new CompiledField.Builder("stars", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).build(), - new CompiledField.Builder("commentary", CompiledGraphQL.CompiledStringType).build(), - new CompiledField.Builder("listOfListOfString", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(CompiledGraphQL.CompiledStringType))))).build(), + new CompiledField.Builder("stars", new CompiledNotNullType(GraphQLInt.type)).build(), + new CompiledField.Builder("commentary", GraphQLString.type).build(), + new CompiledField.Builder("listOfListOfString", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(GraphQLString.type))))).build(), new CompiledField.Builder("listOfListOfEnum", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Episode.type))))).build(), new CompiledField.Builder("listOfListOfCustom", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Date.type))))).build(), new CompiledField.Builder("listOfListOfObject", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Character.type))))).selections(listOfListOfObject).build() diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..c7fc2ca2ec6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..8f0b3d5de1c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLID.java.expected new file mode 100644 index 00000000000..c0dc941c5c3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.Long"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..c16242ba156 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLString.java.expected new file mode 100644 index 00000000000..64383023ad0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.java.expected index f38a6f2058d..0b499427072 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/java/operationBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.java.expected @@ -47,7 +47,7 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.commentary instanceof Optional.Present) { writer.name("commentary"); - new OptionalAdapter<>(Adapters.NullableStringAdapter).toJson(writer, customScalarAdapters, (Optional.Present)value.commentary); + new OptionalAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())).toJson(writer, customScalarAdapters, (Optional.Present)value.commentary); } writer.name("favoriteColor"); new ObjectAdapter(ColorInput_InputAdapter.INSTANCE, false).toJson(writer, customScalarAdapters, value.favoriteColor); @@ -81,10 +81,10 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.listOfString instanceof Optional.Present) { writer.name("listOfString"); - new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(Adapters.NullableStringAdapter))).toJson(writer, customScalarAdapters, (Optional.Present>)value.listOfString); + new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())))).toJson(writer, customScalarAdapters, (Optional.Present>)value.listOfString); } writer.name("listOfStringNonOptional"); - new ListAdapter<>(Adapters.NullableStringAdapter).toJson(writer, customScalarAdapters, value.listOfStringNonOptional); + new ListAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())).toJson(writer, customScalarAdapters, value.listOfStringNonOptional); if (value.listOfInputTypes instanceof Optional.Present) { writer.name("listOfInputTypes"); new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new NullableAdapter<>(new ObjectAdapter(ColorInput_InputAdapter.INSTANCE, false))))).toJson(writer, customScalarAdapters, (Optional.Present>)value.listOfInputTypes); @@ -99,7 +99,7 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.listOfListOfString instanceof Optional.Present) { writer.name("listOfListOfString"); - new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(Adapters.StringAdapter)))).toJson(writer, customScalarAdapters, (Optional.Present>>)value.listOfListOfString); + new OptionalAdapter<>(new NullableAdapter<>(new ListAdapter<>(new ListAdapter<>(new com.example.MyStringAdapter())))).toJson(writer, customScalarAdapters, (Optional.Present>>)value.listOfListOfString); } if (value.listOfListOfEnum instanceof Optional.Present) { writer.name("listOfListOfEnum"); @@ -115,7 +115,7 @@ public enum ReviewInput_InputAdapter implements Adapter { } if (value.CapitalizedField instanceof Optional.Present) { writer.name("CapitalizedField"); - new OptionalAdapter<>(Adapters.NullableStringAdapter).toJson(writer, customScalarAdapters, (Optional.Present)value.CapitalizedField); + new OptionalAdapter<>(new NullableAdapter<>(new com.example.MyStringAdapter())).toJson(writer, customScalarAdapters, (Optional.Present)value.CapitalizedField); } if (value.CapitalizedInt instanceof Optional.Present) { writer.name("CapitalizedInt"); diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/CreateReviewForEpisode.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/CreateReviewForEpisode.kt.expected index 7981bb08b80..e2efe3ee417 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/CreateReviewForEpisode.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/CreateReviewForEpisode.kt.expected @@ -59,11 +59,11 @@ internal data class CreateReviewForEpisode( /** * Comment about the movie */ - public val commentary: String?, + public val commentary: java.lang.String?, /** * for test purpose only */ - public val listOfListOfString: List>?, + public val listOfListOfString: List>?, /** * for test purpose only */ @@ -81,7 +81,7 @@ internal data class CreateReviewForEpisode( /** * The name of the character */ - public val name: String + public val name: java.lang.String ) } } diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.kt.expected index 7a90a9a875c..cd424d96ee8 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/adapter/CreateReviewForEpisode_ResponseAdapter.kt.expected @@ -8,8 +8,6 @@ package com.example.mutation_create_review.adapter import com.apollographql.apollo3.api.Adapter import com.apollographql.apollo3.api.CustomScalarAdapters import com.apollographql.apollo3.api.IntAdapter -import com.apollographql.apollo3.api.NullableStringAdapter -import com.apollographql.apollo3.api.StringAdapter import com.apollographql.apollo3.api.json.JsonReader import com.apollographql.apollo3.api.json.JsonWriter import com.apollographql.apollo3.api.list @@ -60,8 +58,8 @@ internal object CreateReviewForEpisode_ResponseAdapter { public override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): CreateReviewForEpisode.Data.CreateReview { var stars: Int? = null - var commentary: String? = null - var listOfListOfString: List>? = null + var commentary: java.lang.String? = null + var listOfListOfString: List>? = null var listOfListOfEnum: List>? = null var listOfListOfCustom: List>? = null var listOfListOfObject: List>? = null @@ -69,8 +67,9 @@ internal object CreateReviewForEpisode_ResponseAdapter { while(true) { when (reader.selectName(RESPONSE_NAMES)) { 0 -> stars = IntAdapter.fromJson(reader, customScalarAdapters) - 1 -> commentary = NullableStringAdapter.fromJson(reader, customScalarAdapters) - 2 -> listOfListOfString = StringAdapter.list().list().nullable().fromJson(reader, + 1 -> commentary = com.example.MyStringAdapter().nullable().fromJson(reader, + customScalarAdapters) + 2 -> listOfListOfString = com.example.MyStringAdapter().list().list().nullable().fromJson(reader, customScalarAdapters) 3 -> listOfListOfEnum = Episode_ResponseAdapter.list().list().nullable().fromJson(reader, customScalarAdapters) @@ -101,10 +100,11 @@ internal object CreateReviewForEpisode_ResponseAdapter { IntAdapter.toJson(writer, customScalarAdapters, value.stars) writer.name("commentary") - NullableStringAdapter.toJson(writer, customScalarAdapters, value.commentary) + com.example.MyStringAdapter().nullable().toJson(writer, customScalarAdapters, + value.commentary) writer.name("listOfListOfString") - StringAdapter.list().list().nullable().toJson(writer, customScalarAdapters, + com.example.MyStringAdapter().list().list().nullable().toJson(writer, customScalarAdapters, value.listOfListOfString) writer.name("listOfListOfEnum") @@ -127,11 +127,11 @@ internal object CreateReviewForEpisode_ResponseAdapter { public override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): CreateReviewForEpisode.Data.CreateReview.ListOfListOfObject { - var name: String? = null + var name: java.lang.String? = null while(true) { when (reader.selectName(RESPONSE_NAMES)) { - 0 -> name = StringAdapter.fromJson(reader, customScalarAdapters) + 0 -> name = com.example.MyStringAdapter().fromJson(reader, customScalarAdapters) else -> break } } @@ -147,7 +147,7 @@ internal object CreateReviewForEpisode_ResponseAdapter { `value`: CreateReviewForEpisode.Data.CreateReview.ListOfListOfObject ): Unit { writer.name("name") - StringAdapter.toJson(writer, customScalarAdapters, value.name) + com.example.MyStringAdapter().toJson(writer, customScalarAdapters, value.name) } } } diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.kt.expected index a7e15394315..5d08bcf804b 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/selections/CreateReviewForEpisodeSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.mutation_create_review.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.mutation_create_review.type.Character import com.example.mutation_create_review.type.Date import com.example.mutation_create_review.type.Episode +import com.example.mutation_create_review.type.GraphQLInt +import com.example.mutation_create_review.type.GraphQLString import com.example.mutation_create_review.type.Review import kotlin.collections.List @@ -23,22 +23,22 @@ internal object CreateReviewForEpisodeSelections { private val listOfListOfObject: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val createReview: List = listOf( CompiledField.Builder( name = "stars", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).build(), CompiledField.Builder( name = "commentary", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "listOfListOfString", - type = CompiledStringType.notNull().list().notNull().list() + type = GraphQLString.type.notNull().list().notNull().list() ).build(), CompiledField.Builder( name = "listOfListOfEnum", diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c5e3e25642f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +internal class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..bd9396e590a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +internal class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..6f8eea2e827 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +internal class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "java.lang.Long") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..8106ec52034 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +internal class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..5e4c62d06f5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +internal class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "java.lang.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/ReviewInput.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/ReviewInput.kt.expected index 7dadc49dc9a..a4204b38a6e 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/ReviewInput.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/ReviewInput.kt.expected @@ -6,10 +6,10 @@ package com.example.mutation_create_review.type import com.apollographql.apollo3.api.Optional +import java.lang.String import java.util.Date import kotlin.Boolean import kotlin.Int -import kotlin.String import kotlin.collections.List /** diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.kt.expected index d00900422a1..7023d117220 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review/kotlin/responseBased/mutation_create_review/type/adapter/ReviewInput_InputAdapter.kt.expected @@ -10,9 +10,7 @@ import com.apollographql.apollo3.api.CustomScalarAdapters import com.apollographql.apollo3.api.IntAdapter import com.apollographql.apollo3.api.NullableBooleanAdapter import com.apollographql.apollo3.api.NullableIntAdapter -import com.apollographql.apollo3.api.NullableStringAdapter import com.apollographql.apollo3.api.Optional -import com.apollographql.apollo3.api.StringAdapter import com.apollographql.apollo3.api.json.JsonReader import com.apollographql.apollo3.api.json.JsonWriter import com.apollographql.apollo3.api.list @@ -42,7 +40,8 @@ internal object ReviewInput_InputAdapter : Adapter { } if (value.commentary is Optional.Present) { writer.name("commentary") - NullableStringAdapter.optional().toJson(writer, customScalarAdapters, value.commentary) + com.example.MyStringAdapter().nullable().optional().toJson(writer, customScalarAdapters, + value.commentary) } writer.name("favoriteColor") ColorInput_InputAdapter.obj().toJson(writer, customScalarAdapters, value.favoriteColor) @@ -83,11 +82,12 @@ internal object ReviewInput_InputAdapter : Adapter { } if (value.listOfString is Optional.Present) { writer.name("listOfString") - NullableStringAdapter.list().nullable().optional().toJson(writer, customScalarAdapters, - value.listOfString) + com.example.MyStringAdapter().nullable().list().nullable().optional().toJson(writer, + customScalarAdapters, value.listOfString) } writer.name("listOfStringNonOptional") - NullableStringAdapter.list().toJson(writer, customScalarAdapters, value.listOfStringNonOptional) + com.example.MyStringAdapter().nullable().list().toJson(writer, customScalarAdapters, + value.listOfStringNonOptional) if (value.listOfInputTypes is Optional.Present) { writer.name("listOfInputTypes") ColorInput_InputAdapter.obj().nullable().list().nullable().optional().toJson(writer, @@ -105,8 +105,8 @@ internal object ReviewInput_InputAdapter : Adapter { } if (value.listOfListOfString is Optional.Present) { writer.name("listOfListOfString") - StringAdapter.list().list().nullable().optional().toJson(writer, customScalarAdapters, - value.listOfListOfString) + com.example.MyStringAdapter().list().list().nullable().optional().toJson(writer, + customScalarAdapters, value.listOfListOfString) } if (value.listOfListOfEnum is Optional.Present) { writer.name("listOfListOfEnum") @@ -125,7 +125,8 @@ internal object ReviewInput_InputAdapter : Adapter { } if (value.CapitalizedField is Optional.Present) { writer.name("CapitalizedField") - NullableStringAdapter.optional().toJson(writer, customScalarAdapters, value.CapitalizedField) + com.example.MyStringAdapter().nullable().optional().toJson(writer, customScalarAdapters, + value.CapitalizedField) } if (value.CapitalizedInt is Optional.Present) { writer.name("CapitalizedInt") diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.java.expected index 8939ff61305..545403afb7f 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.java.expected @@ -7,18 +7,19 @@ package com.example.mutation_create_review_semantic_naming.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.mutation_create_review_semantic_naming.type.GraphQLInt; +import com.example.mutation_create_review_semantic_naming.type.GraphQLString; import com.example.mutation_create_review_semantic_naming.type.Review; import java.util.Arrays; import java.util.List; public class CreateReviewForEpisodeMutationSelections { private static List createReview = Arrays.asList( - new CompiledField.Builder("stars", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).build(), - new CompiledField.Builder("commentary", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("stars", new CompiledNotNullType(GraphQLInt.type)).build(), + new CompiledField.Builder("commentary", GraphQLString.type).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/Date.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/Date.java.expected index 45f0cee308f..72f526ffaeb 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/Date.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/Date.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * The `Date` scalar type represents date format. */ public class Date { - public static CustomScalarType type = new CustomScalarType("Date", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("Date", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..ad56506e8ef --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..26ae963e762 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLID.java.expected new file mode 100644 index 00000000000..0a5263acd20 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..88e5bcb0c78 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLString.java.expected new file mode 100644 index 00000000000..8c0ed045e09 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/java/operationBased/mutation_create_review_semantic_naming/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.kt.expected index cb4b1a46714..8c480a05b57 100644 --- a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/selections/CreateReviewForEpisodeMutationSelections.kt.expected @@ -7,11 +7,11 @@ package com.example.mutation_create_review_semantic_naming.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.mutation_create_review_semantic_naming.type.GraphQLInt +import com.example.mutation_create_review_semantic_naming.type.GraphQLString import com.example.mutation_create_review_semantic_naming.type.Review import kotlin.collections.List @@ -19,11 +19,11 @@ public object CreateReviewForEpisodeMutationSelections { private val createReview: List = listOf( CompiledField.Builder( name = "stars", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).build(), CompiledField.Builder( name = "commentary", - type = CompiledStringType + type = GraphQLString.type ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..0a2a50027a2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..b7995d0503d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..cc6faa35238 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..20b68d176d8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f4dac404fd0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/mutation_create_review_semantic_naming/kotlin/responseBased/mutation_create_review_semantic_naming/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.mutation_create_review_semantic_naming.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.java.expected index b3dcf8530e0..63f9a9e5e82 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.java.expected @@ -6,22 +6,22 @@ package com.example.named_fragment_delegate.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.named_fragment_delegate.type.Character; +import com.example.named_fragment_delegate.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DroidDetailsSelections { private static List friends = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.java.expected index de67fb02dcf..e96cc013e7a 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.java.expected @@ -6,20 +6,20 @@ package com.example.named_fragment_delegate.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.named_fragment_delegate.type.Character; import com.example.named_fragment_delegate.type.FriendsConnection; import com.example.named_fragment_delegate.type.FriendsEdge; +import com.example.named_fragment_delegate.type.GraphQLString; import com.example.named_fragment_delegate.type.URL; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -31,7 +31,7 @@ public class HumanDetailsSelections { ); public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("profileLink", new CompiledNotNullType(URL.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/selections/TestQuerySelections.java.expected index 673fc6f6f9d..480cae40f3e 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/selections/TestQuerySelections.java.expected @@ -7,18 +7,18 @@ package com.example.named_fragment_delegate.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.named_fragment_delegate.fragment.selections.DroidDetailsSelections; import com.example.named_fragment_delegate.fragment.selections.HumanDetailsSelections; import com.example.named_fragment_delegate.type.Character; +import com.example.named_fragment_delegate.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetailsSelections.root).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..7e6c8b3f838 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..5012bb9e660 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLID.java.expected new file mode 100644 index 00000000000..8204bafd325 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..1f875bbe0b5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLString.java.expected new file mode 100644 index 00000000000..f0b7d1b4e90 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/URL.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/URL.java.expected index dba7cabe5bd..8101b1a5d23 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/URL.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/java/operationBased/named_fragment_delegate/type/URL.java.expected @@ -11,5 +11,5 @@ import com.apollographql.apollo3.api.CustomScalarType; * URL for testing */ public class URL { - public static CustomScalarType type = new CustomScalarType("URL", "kotlin.Any"); + public static CustomScalarType type = new CustomScalarType("URL", "java.lang.Object"); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected index 585245eba9e..1662332cc7d 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,28 +7,28 @@ package com.example.named_fragment_delegate.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.type.Character +import com.example.named_fragment_delegate.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { private val friends: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected index 580d61b3444..cd6330c9079 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,12 +7,12 @@ package com.example.named_fragment_delegate.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.type.Character import com.example.named_fragment_delegate.type.FriendsConnection import com.example.named_fragment_delegate.type.FriendsEdge +import com.example.named_fragment_delegate.type.GraphQLString import com.example.named_fragment_delegate.type.URL import kotlin.collections.List @@ -20,7 +20,7 @@ public object HumanDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -43,7 +43,7 @@ public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "profileLink", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/selections/TestQuerySelections.kt.expected index 147a8eb61d4..57be9a17986 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.named_fragment_delegate.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.fragment.selections.DroidDetailsSelections import com.example.named_fragment_delegate.fragment.selections.HumanDetailsSelections import com.example.named_fragment_delegate.type.Character +import com.example.named_fragment_delegate.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..742902fe27f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ea2f17b2ca1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2675271b439 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..3c4477e58a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..91185b5dbb8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/compat/named_fragment_delegate/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected index 585245eba9e..1662332cc7d 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,28 +7,28 @@ package com.example.named_fragment_delegate.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.type.Character +import com.example.named_fragment_delegate.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { private val friends: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected index 580d61b3444..cd6330c9079 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,12 +7,12 @@ package com.example.named_fragment_delegate.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.type.Character import com.example.named_fragment_delegate.type.FriendsConnection import com.example.named_fragment_delegate.type.FriendsEdge +import com.example.named_fragment_delegate.type.GraphQLString import com.example.named_fragment_delegate.type.URL import kotlin.collections.List @@ -20,7 +20,7 @@ public object HumanDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -43,7 +43,7 @@ public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "profileLink", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected index 147a8eb61d4..57be9a17986 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.named_fragment_delegate.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.fragment.selections.DroidDetailsSelections import com.example.named_fragment_delegate.fragment.selections.HumanDetailsSelections import com.example.named_fragment_delegate.type.Character +import com.example.named_fragment_delegate.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..742902fe27f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ea2f17b2ca1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2675271b439 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..3c4477e58a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..91185b5dbb8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/operationBased/named_fragment_delegate/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected index 585245eba9e..1662332cc7d 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,28 +7,28 @@ package com.example.named_fragment_delegate.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.type.Character +import com.example.named_fragment_delegate.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { private val friends: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected index 580d61b3444..cd6330c9079 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,12 +7,12 @@ package com.example.named_fragment_delegate.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.type.Character import com.example.named_fragment_delegate.type.FriendsConnection import com.example.named_fragment_delegate.type.FriendsEdge +import com.example.named_fragment_delegate.type.GraphQLString import com.example.named_fragment_delegate.type.URL import kotlin.collections.List @@ -20,7 +20,7 @@ public object HumanDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -43,7 +43,7 @@ public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "profileLink", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected index 147a8eb61d4..57be9a17986 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.named_fragment_delegate.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_delegate.fragment.selections.DroidDetailsSelections import com.example.named_fragment_delegate.fragment.selections.HumanDetailsSelections import com.example.named_fragment_delegate.type.Character +import com.example.named_fragment_delegate.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..742902fe27f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ea2f17b2ca1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2675271b439 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..3c4477e58a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..91185b5dbb8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_delegate/kotlin/responseBased/named_fragment_delegate/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_delegate.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.java.expected index d328f5fe220..8b3a4091a17 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.java.expected @@ -6,14 +6,14 @@ package com.example.named_fragment_inside_inline_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class characterNameSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.java.expected index 28ee05f1220..b8570c4fb3d 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.java.expected @@ -7,24 +7,24 @@ package com.example.named_fragment_inside_inline_fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterAppearsInSelections; import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterNameSelections; import com.example.named_fragment_inside_inline_fragment.type.Character; +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class GetHeroSelections { private static List onCharacter = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(characterNameSelections.root).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(characterAppearsInSelections.root).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..5b909485234 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..ea7eeda8cc5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..42b8c886660 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..4491f74612b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..1c4d3d0281d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/java/operationBased/named_fragment_inside_inline_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected index d7cb57b26e9..5aa92ecd769 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.named_fragment_inside_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString import kotlin.collections.List public object characterNameSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected index bd0abf6ceec..2e2fbd317e4 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected @@ -8,18 +8,18 @@ package com.example.named_fragment_inside_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterAppearsInSelections import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterNameSelections import com.example.named_fragment_inside_inline_fragment.type.Character +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString import kotlin.collections.List public object GetHeroSelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -36,7 +36,7 @@ public object GetHeroSelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c7cce4a49a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..17301ce1159 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2b74ffebd35 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..db70de96d45 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f8b3e42ddc5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/compat/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected index d7cb57b26e9..5aa92ecd769 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.named_fragment_inside_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString import kotlin.collections.List public object characterNameSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected index bd0abf6ceec..2e2fbd317e4 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected @@ -8,18 +8,18 @@ package com.example.named_fragment_inside_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterAppearsInSelections import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterNameSelections import com.example.named_fragment_inside_inline_fragment.type.Character +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString import kotlin.collections.List public object GetHeroSelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -36,7 +36,7 @@ public object GetHeroSelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c7cce4a49a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..17301ce1159 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2b74ffebd35 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..db70de96d45 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f8b3e42ddc5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/operationBased/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected index d7cb57b26e9..5aa92ecd769 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/fragment/selections/characterNameSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.named_fragment_inside_inline_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString import kotlin.collections.List public object characterNameSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected index bd0abf6ceec..2e2fbd317e4 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/selections/GetHeroSelections.kt.expected @@ -8,18 +8,18 @@ package com.example.named_fragment_inside_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterAppearsInSelections import com.example.named_fragment_inside_inline_fragment.fragment.selections.characterNameSelections import com.example.named_fragment_inside_inline_fragment.type.Character +import com.example.named_fragment_inside_inline_fragment.type.GraphQLString import kotlin.collections.List public object GetHeroSelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -36,7 +36,7 @@ public object GetHeroSelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..c7cce4a49a3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..17301ce1159 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2b74ffebd35 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..db70de96d45 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..f8b3e42ddc5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_inside_inline_fragment/kotlin/responseBased/named_fragment_inside_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_inside_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.java.expected index da3b84ba80e..e90b4af7c4a 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.java.expected @@ -8,11 +8,11 @@ package com.example.named_fragment_with_variables.fragment.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.named_fragment_with_variables.type.GraphQLString; import com.example.named_fragment_with_variables.type.Organization; import com.example.named_fragment_with_variables.type.User; import java.util.Arrays; @@ -20,12 +20,12 @@ import java.util.List; public class QueryFragmentSelections { private static List user = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("User", Arrays.asList("User")).selections(UserFragmentSelections.root).build() ); private static List organization = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("user", new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(User.type)))).arguments(Arrays.asList(new CompiledArgument("query", new CompiledVariable("query"), false))).selections(user).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.java.expected index 481d2ca3429..6ba36660f64 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.java.expected @@ -7,17 +7,17 @@ package com.example.named_fragment_with_variables.fragment.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.named_fragment_with_variables.type.GraphQLString; import java.util.Arrays; import java.util.List; public class UserFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("firstName", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("lastName", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("avatar", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).arguments(Arrays.asList(new CompiledArgument("size", new CompiledVariable("size"), false))).build() + new CompiledField.Builder("firstName", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("lastName", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("avatar", new CompiledNotNullType(GraphQLString.type)).arguments(Arrays.asList(new CompiledArgument("size", new CompiledVariable("size"), false))).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/selections/GetUserSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/selections/GetUserSelections.java.expected index 6e76e23846c..1317425cb59 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/selections/GetUserSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/selections/GetUserSelections.java.expected @@ -7,16 +7,16 @@ package com.example.named_fragment_with_variables.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.named_fragment_with_variables.fragment.selections.QueryFragmentSelections; +import com.example.named_fragment_with_variables.type.GraphQLString; import java.util.Arrays; import java.util.List; public class GetUserSelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Query", Arrays.asList("Query")).selections(QueryFragmentSelections.root).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..2f12dc1ebc3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..e4a4a3ff097 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLID.java.expected new file mode 100644 index 00000000000..4a5eb8fe080 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..5707790c627 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLString.java.expected new file mode 100644 index 00000000000..f59759d0989 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/java/operationBased/named_fragment_with_variables/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected index 0a6f8e961dd..aded5e0ce7c 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_with_variables.type.GraphQLString import com.example.named_fragment_with_variables.type.Organization import com.example.named_fragment_with_variables.type.User import kotlin.collections.List @@ -21,7 +21,7 @@ public object QueryFragmentSelections { private val user: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "User", @@ -33,7 +33,7 @@ public object QueryFragmentSelections { private val organization: List = listOf( CompiledField.Builder( name = "id", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "user", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected index abafb1b2548..066676afc7e 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected @@ -8,24 +8,24 @@ package com.example.named_fragment_with_variables.fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_with_variables.type.GraphQLString import kotlin.collections.List public object UserFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "firstName", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "lastName", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "avatar", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).arguments(listOf( CompiledArgument("size", CompiledVariable("size")) )) diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/selections/GetUserSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/selections/GetUserSelections.kt.expected index 40d90bd5857..e912995ff1c 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/selections/GetUserSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/selections/GetUserSelections.kt.expected @@ -8,16 +8,16 @@ package com.example.named_fragment_with_variables.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_with_variables.fragment.selections.QueryFragmentSelections +import com.example.named_fragment_with_variables.type.GraphQLString import kotlin.collections.List public object GetUserSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..7bbec0e21e4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8dd0f75ba18 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f916e486133 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..29a7a722690 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..af5c779b03d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/compat/named_fragment_with_variables/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected index 0a6f8e961dd..aded5e0ce7c 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_with_variables.type.GraphQLString import com.example.named_fragment_with_variables.type.Organization import com.example.named_fragment_with_variables.type.User import kotlin.collections.List @@ -21,7 +21,7 @@ public object QueryFragmentSelections { private val user: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "User", @@ -33,7 +33,7 @@ public object QueryFragmentSelections { private val organization: List = listOf( CompiledField.Builder( name = "id", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "user", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected index abafb1b2548..066676afc7e 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected @@ -8,24 +8,24 @@ package com.example.named_fragment_with_variables.fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_with_variables.type.GraphQLString import kotlin.collections.List public object UserFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "firstName", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "lastName", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "avatar", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).arguments(listOf( CompiledArgument("size", CompiledVariable("size")) )) diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected index 40d90bd5857..e912995ff1c 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected @@ -8,16 +8,16 @@ package com.example.named_fragment_with_variables.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_with_variables.fragment.selections.QueryFragmentSelections +import com.example.named_fragment_with_variables.type.GraphQLString import kotlin.collections.List public object GetUserSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..7bbec0e21e4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8dd0f75ba18 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f916e486133 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..29a7a722690 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..af5c779b03d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/operationBased/named_fragment_with_variables/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected index 0a6f8e961dd..aded5e0ce7c 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/QueryFragmentSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_with_variables.type.GraphQLString import com.example.named_fragment_with_variables.type.Organization import com.example.named_fragment_with_variables.type.User import kotlin.collections.List @@ -21,7 +21,7 @@ public object QueryFragmentSelections { private val user: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "User", @@ -33,7 +33,7 @@ public object QueryFragmentSelections { private val organization: List = listOf( CompiledField.Builder( name = "id", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "user", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected index abafb1b2548..066676afc7e 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/fragment/selections/UserFragmentSelections.kt.expected @@ -8,24 +8,24 @@ package com.example.named_fragment_with_variables.fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull +import com.example.named_fragment_with_variables.type.GraphQLString import kotlin.collections.List public object UserFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "firstName", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "lastName", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "avatar", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).arguments(listOf( CompiledArgument("size", CompiledVariable("size")) )) diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected index 40d90bd5857..e912995ff1c 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/selections/GetUserSelections.kt.expected @@ -8,16 +8,16 @@ package com.example.named_fragment_with_variables.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_with_variables.fragment.selections.QueryFragmentSelections +import com.example.named_fragment_with_variables.type.GraphQLString import kotlin.collections.List public object GetUserSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..7bbec0e21e4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8dd0f75ba18 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f916e486133 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..29a7a722690 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..af5c779b03d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_with_variables/kotlin/responseBased/named_fragment_with_variables/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_with_variables.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.java.expected index e20fada93ff..198632a6b3e 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.java.expected @@ -6,13 +6,13 @@ package com.example.named_fragment_without_implementation.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.named_fragment_without_implementation.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DroidDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.java.expected index f9dee1e4d88..1433a207847 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.java.expected @@ -6,13 +6,13 @@ package com.example.named_fragment_without_implementation.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.named_fragment_without_implementation.type.GraphQLFloat; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("height", GraphQLFloat.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.java.expected index 38c24a5a1ba..0b68f704dd9 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.java.expected @@ -7,19 +7,19 @@ package com.example.named_fragment_without_implementation.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.named_fragment_without_implementation.fragment.selections.DroidDetailsSelections; import com.example.named_fragment_without_implementation.fragment.selections.HumanDetailsSelections; import com.example.named_fragment_without_implementation.type.Character; +import com.example.named_fragment_without_implementation.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(DroidDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..e6c62b4af58 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..f49fa78d8be --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLID.java.expected new file mode 100644 index 00000000000..172399d0642 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..6e2e73fd469 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLString.java.expected new file mode 100644 index 00000000000..ed7cf99a32a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/java/operationBased/named_fragment_without_implementation/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected index 85db07ebcf7..96614433825 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.named_fragment_without_implementation.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.named_fragment_without_implementation.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected index 2e992f9bd07..09952c0edee 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected @@ -6,15 +6,15 @@ package com.example.named_fragment_without_implementation.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection +import com.example.named_fragment_without_implementation.type.GraphQLFloat import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected index 4821f48d2c9..99bcf628c80 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected @@ -8,22 +8,22 @@ package com.example.named_fragment_without_implementation.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_without_implementation.fragment.selections.DroidDetailsSelections import com.example.named_fragment_without_implementation.fragment.selections.HumanDetailsSelections import com.example.named_fragment_without_implementation.type.Character +import com.example.named_fragment_without_implementation.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e4db506edfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..e5085c8af02 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2ee3605380a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..56cc23c5729 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0d342d05fd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/compat/named_fragment_without_implementation/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected index 85db07ebcf7..96614433825 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.named_fragment_without_implementation.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.named_fragment_without_implementation.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected index 2e992f9bd07..09952c0edee 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected @@ -6,15 +6,15 @@ package com.example.named_fragment_without_implementation.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection +import com.example.named_fragment_without_implementation.type.GraphQLFloat import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected index 4821f48d2c9..99bcf628c80 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected @@ -8,22 +8,22 @@ package com.example.named_fragment_without_implementation.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_without_implementation.fragment.selections.DroidDetailsSelections import com.example.named_fragment_without_implementation.fragment.selections.HumanDetailsSelections import com.example.named_fragment_without_implementation.type.Character +import com.example.named_fragment_without_implementation.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e4db506edfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..e5085c8af02 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2ee3605380a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..56cc23c5729 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0d342d05fd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/operationBased/named_fragment_without_implementation/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected index 85db07ebcf7..96614433825 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/DroidDetailsSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.named_fragment_without_implementation.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.named_fragment_without_implementation.type.GraphQLString import kotlin.collections.List public object DroidDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected index 2e992f9bd07..09952c0edee 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/fragment/selections/HumanDetailsSelections.kt.expected @@ -6,15 +6,15 @@ package com.example.named_fragment_without_implementation.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledSelection +import com.example.named_fragment_without_implementation.type.GraphQLFloat import kotlin.collections.List public object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected index 4821f48d2c9..99bcf628c80 100644 --- a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/selections/TestQuerySelections.kt.expected @@ -8,22 +8,22 @@ package com.example.named_fragment_without_implementation.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.named_fragment_without_implementation.fragment.selections.DroidDetailsSelections import com.example.named_fragment_without_implementation.fragment.selections.HumanDetailsSelections import com.example.named_fragment_without_implementation.type.Character +import com.example.named_fragment_without_implementation.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e4db506edfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..e5085c8af02 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..2ee3605380a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..56cc23c5729 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0d342d05fd5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/named_fragment_without_implementation/kotlin/responseBased/named_fragment_without_implementation/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.named_fragment_without_implementation.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/selections/TestQuerySelections.java.expected index 54d22bb74e0..51a678b0991 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/selections/TestQuerySelections.java.expected @@ -8,23 +8,24 @@ package com.example.nested_conditional_inline.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.example.nested_conditional_inline.type.Character; +import com.example.nested_conditional_inline.type.GraphQLFloat; +import com.example.nested_conditional_inline.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onHuman1 = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).arguments(Arrays.asList(new CompiledArgument("unit", "FOOT", false))).build() + new CompiledField.Builder("height", GraphQLFloat.type).arguments(Arrays.asList(new CompiledArgument("unit", "FOOT", false))).build() ); private static List friends = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman1).build() ); @@ -33,12 +34,12 @@ public class TestQuerySelections { ); private static List onHuman2 = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).arguments(Arrays.asList(new CompiledArgument("unit", "METER", false))).build() + new CompiledField.Builder("height", GraphQLFloat.type).arguments(Arrays.asList(new CompiledArgument("unit", "METER", false))).build() ); private static List friends1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman2).build() ); @@ -47,8 +48,8 @@ public class TestQuerySelections { ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..f03301517af --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..b7d2e4dacf4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLID.java.expected new file mode 100644 index 00000000000..25fbed5eaac --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..eeee9f3a582 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLString.java.expected new file mode 100644 index 00000000000..2b4f6a7e7be --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/java/operationBased/nested_conditional_inline/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/selections/TestQuerySelections.kt.expected index 44144ab6cf5..d4068ecebf9 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/selections/TestQuerySelections.kt.expected @@ -7,21 +7,21 @@ package com.example.nested_conditional_inline.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.nested_conditional_inline.type.Character +import com.example.nested_conditional_inline.type.GraphQLFloat +import com.example.nested_conditional_inline.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman1: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "FOOT") )) @@ -31,11 +31,11 @@ public object TestQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -55,7 +55,7 @@ public object TestQuerySelections { private val onHuman2: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "METER") )) @@ -65,11 +65,11 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -89,11 +89,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..184b7cb030e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..36b2c099906 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8a1045e27a8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..0181122a03b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..94895105601 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/compat/nested_conditional_inline/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected index 44144ab6cf5..d4068ecebf9 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected @@ -7,21 +7,21 @@ package com.example.nested_conditional_inline.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.nested_conditional_inline.type.Character +import com.example.nested_conditional_inline.type.GraphQLFloat +import com.example.nested_conditional_inline.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman1: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "FOOT") )) @@ -31,11 +31,11 @@ public object TestQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -55,7 +55,7 @@ public object TestQuerySelections { private val onHuman2: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "METER") )) @@ -65,11 +65,11 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -89,11 +89,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..184b7cb030e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..36b2c099906 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8a1045e27a8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..0181122a03b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..94895105601 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/operationBased/nested_conditional_inline/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected index 44144ab6cf5..d4068ecebf9 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/selections/TestQuerySelections.kt.expected @@ -7,21 +7,21 @@ package com.example.nested_conditional_inline.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.nested_conditional_inline.type.Character +import com.example.nested_conditional_inline.type.GraphQLFloat +import com.example.nested_conditional_inline.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman1: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "FOOT") )) @@ -31,11 +31,11 @@ public object TestQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -55,7 +55,7 @@ public object TestQuerySelections { private val onHuman2: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).arguments(listOf( CompiledArgument("unit", "METER") )) @@ -65,11 +65,11 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -89,11 +89,11 @@ public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..184b7cb030e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..36b2c099906 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8a1045e27a8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..0181122a03b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..94895105601 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_conditional_inline/kotlin/responseBased/nested_conditional_inline/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_conditional_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.java.expected index 9efef85a976..da9522032ba 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.java.expected @@ -7,9 +7,9 @@ package com.example.nested_field_with_multiple_fieldsets.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.nested_field_with_multiple_fieldsets.type.GraphQLString; import com.example.nested_field_with_multiple_fieldsets.type.Iface1; import com.example.nested_field_with_multiple_fieldsets.type.Iface2; import java.util.Arrays; @@ -17,15 +17,15 @@ import java.util.List; public class TestQuerySelections { private static List onIface2 = Arrays.asList( - new CompiledField.Builder("scalar1", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("scalar1", GraphQLString.type).build() ); private static List onImpl2 = Arrays.asList( - new CompiledField.Builder("scalar2", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("scalar2", GraphQLString.type).build() ); private static List iface2 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Iface2", Arrays.asList("Impl2")).selections(onIface2).build(), new CompiledFragment.Builder("Impl2", Arrays.asList("Impl2")).selections(onImpl2).build() ); @@ -35,15 +35,15 @@ public class TestQuerySelections { ); private static List onIface21 = Arrays.asList( - new CompiledField.Builder("scalar3", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("scalar3", GraphQLString.type).build() ); private static List onImpl21 = Arrays.asList( - new CompiledField.Builder("scalar4", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("scalar4", GraphQLString.type).build() ); private static List iface21 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Iface2", Arrays.asList("Impl2")).selections(onIface21).build(), new CompiledFragment.Builder("Impl2", Arrays.asList("Impl2")).selections(onImpl21).build() ); @@ -53,7 +53,7 @@ public class TestQuerySelections { ); private static List iface1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Iface1", Arrays.asList("Impl1")).selections(onIface1).build(), new CompiledFragment.Builder("Impl1", Arrays.asList("Impl1")).selections(onImpl1).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..4756c6a0ee5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..96985b15f05 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLID.java.expected new file mode 100644 index 00000000000..7fadd93fd4b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..66f71f10565 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLString.java.expected new file mode 100644 index 00000000000..612a19da8ed --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/java/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected index 3899634d57f..7998311b032 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected @@ -8,8 +8,8 @@ package com.example.nested_field_with_multiple_fieldsets.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.nested_field_with_multiple_fieldsets.type.GraphQLString import com.example.nested_field_with_multiple_fieldsets.type.Iface1 import com.example.nested_field_with_multiple_fieldsets.type.Iface2 import kotlin.collections.List @@ -18,21 +18,21 @@ public object TestQuerySelections { private val onIface2: List = listOf( CompiledField.Builder( name = "scalar1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onImpl2: List = listOf( CompiledField.Builder( name = "scalar2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val iface2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface2", @@ -57,21 +57,21 @@ public object TestQuerySelections { private val onIface21: List = listOf( CompiledField.Builder( name = "scalar3", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onImpl21: List = listOf( CompiledField.Builder( name = "scalar4", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val iface21: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface2", @@ -96,7 +96,7 @@ public object TestQuerySelections { private val iface1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface1", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4b7c3910e2b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d52a1f6d0c8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9109122441b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1389645a49c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..845d45cc8d0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/compat/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected index 3899634d57f..7998311b032 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected @@ -8,8 +8,8 @@ package com.example.nested_field_with_multiple_fieldsets.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.nested_field_with_multiple_fieldsets.type.GraphQLString import com.example.nested_field_with_multiple_fieldsets.type.Iface1 import com.example.nested_field_with_multiple_fieldsets.type.Iface2 import kotlin.collections.List @@ -18,21 +18,21 @@ public object TestQuerySelections { private val onIface2: List = listOf( CompiledField.Builder( name = "scalar1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onImpl2: List = listOf( CompiledField.Builder( name = "scalar2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val iface2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface2", @@ -57,21 +57,21 @@ public object TestQuerySelections { private val onIface21: List = listOf( CompiledField.Builder( name = "scalar3", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onImpl21: List = listOf( CompiledField.Builder( name = "scalar4", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val iface21: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface2", @@ -96,7 +96,7 @@ public object TestQuerySelections { private val iface1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface1", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4b7c3910e2b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d52a1f6d0c8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9109122441b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1389645a49c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..845d45cc8d0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/operationBased/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected index 3899634d57f..7998311b032 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/selections/TestQuerySelections.kt.expected @@ -8,8 +8,8 @@ package com.example.nested_field_with_multiple_fieldsets.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.nested_field_with_multiple_fieldsets.type.GraphQLString import com.example.nested_field_with_multiple_fieldsets.type.Iface1 import com.example.nested_field_with_multiple_fieldsets.type.Iface2 import kotlin.collections.List @@ -18,21 +18,21 @@ public object TestQuerySelections { private val onIface2: List = listOf( CompiledField.Builder( name = "scalar1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onImpl2: List = listOf( CompiledField.Builder( name = "scalar2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val iface2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface2", @@ -57,21 +57,21 @@ public object TestQuerySelections { private val onIface21: List = listOf( CompiledField.Builder( name = "scalar3", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onImpl21: List = listOf( CompiledField.Builder( name = "scalar4", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val iface21: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface2", @@ -96,7 +96,7 @@ public object TestQuerySelections { private val iface1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Iface1", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4b7c3910e2b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d52a1f6d0c8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9109122441b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1389645a49c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..845d45cc8d0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_field_with_multiple_fieldsets/kotlin/responseBased/nested_field_with_multiple_fieldsets/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_field_with_multiple_fieldsets.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.java.expected index 5559be3fb36..9cbb0ac9db1 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.java.expected @@ -7,21 +7,21 @@ package com.example.nested_named_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.nested_named_fragments.type.GraphQLString; import com.example.nested_named_fragments.type.Planet; import java.util.Arrays; import java.util.List; public class pilotFragmentSelections { private static List homeworld = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Planet", Arrays.asList("Planet")).selections(planetFragmentSelections.root).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("name", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("name", GraphQLString.type).build(), new CompiledField.Builder("homeworld", Planet.type).selections(homeworld).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.java.expected index 2778000219a..524e6d625cf 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.java.expected @@ -6,13 +6,13 @@ package com.example.nested_named_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.nested_named_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class planetFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.java.expected index 699f3a4f835..cd2228483cf 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.java.expected @@ -7,10 +7,11 @@ package com.example.nested_named_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.nested_named_fragments.type.GraphQLID; +import com.example.nested_named_fragments.type.GraphQLString; import com.example.nested_named_fragments.type.Person; import com.example.nested_named_fragments.type.StarshipPilotsConnection; import com.example.nested_named_fragments.type.StarshipPilotsEdge; @@ -19,7 +20,7 @@ import java.util.List; public class starshipFragmentSelections { private static List node = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Person", Arrays.asList("Person")).selections(pilotFragmentSelections.root).build() ); @@ -32,8 +33,8 @@ public class starshipFragmentSelections { ); public static List root = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", GraphQLString.type).build(), new CompiledField.Builder("pilotConnection", StarshipPilotsConnection.type).selections(pilotConnection).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/selections/AllStarshipsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/selections/AllStarshipsSelections.java.expected index 22bfaf5f794..b27fa7a9a57 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/selections/AllStarshipsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/selections/AllStarshipsSelections.java.expected @@ -8,11 +8,11 @@ package com.example.nested_named_fragments.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.nested_named_fragments.fragment.selections.starshipFragmentSelections; +import com.example.nested_named_fragments.type.GraphQLString; import com.example.nested_named_fragments.type.Starship; import com.example.nested_named_fragments.type.StarshipsConnection; import com.example.nested_named_fragments.type.StarshipsEdge; @@ -21,7 +21,7 @@ import java.util.List; public class AllStarshipsSelections { private static List node = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Starship", Arrays.asList("Starship")).selections(starshipFragmentSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..42e5eb7c722 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..82941e8ce27 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLID.java.expected new file mode 100644 index 00000000000..e53281c1ac2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..19a043fba79 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLString.java.expected new file mode 100644 index 00000000000..3e6b640d7c5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/java/operationBased/nested_named_fragments/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected index 76d566c5c87..7dd4b8da754 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected @@ -8,8 +8,8 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Planet import kotlin.collections.List @@ -17,7 +17,7 @@ public object pilotFragmentSelections { private val homeworld: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Planet", @@ -29,7 +29,7 @@ public object pilotFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "homeworld", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected index 2865b7b0dc7..db1321fa96f 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.nested_named_fragments.type.GraphQLString import kotlin.collections.List public object planetFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected index db0b0502cfe..dd7e2ddb1e9 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected @@ -7,11 +7,11 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.nested_named_fragments.type.GraphQLID +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Person import com.example.nested_named_fragments.type.StarshipPilotsConnection import com.example.nested_named_fragments.type.StarshipPilotsEdge @@ -21,7 +21,7 @@ public object starshipFragmentSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Person", @@ -49,11 +49,11 @@ public object starshipFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "pilotConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/selections/AllStarshipsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/selections/AllStarshipsSelections.kt.expected index cff98013fe8..dd61459e06b 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/selections/AllStarshipsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/selections/AllStarshipsSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.nested_named_fragments.fragment.selections.starshipFragmentSelections +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Starship import com.example.nested_named_fragments.type.StarshipsConnection import com.example.nested_named_fragments.type.StarshipsEdge @@ -22,7 +22,7 @@ public object AllStarshipsSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Starship", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f7dd1bf60a4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5c06d707f79 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..cf34c424e84 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f144a6ba02a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..b6e95578ab2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/compat/nested_named_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected index 76d566c5c87..7dd4b8da754 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected @@ -8,8 +8,8 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Planet import kotlin.collections.List @@ -17,7 +17,7 @@ public object pilotFragmentSelections { private val homeworld: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Planet", @@ -29,7 +29,7 @@ public object pilotFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "homeworld", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected index 2865b7b0dc7..db1321fa96f 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.nested_named_fragments.type.GraphQLString import kotlin.collections.List public object planetFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected index db0b0502cfe..dd7e2ddb1e9 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected @@ -7,11 +7,11 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.nested_named_fragments.type.GraphQLID +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Person import com.example.nested_named_fragments.type.StarshipPilotsConnection import com.example.nested_named_fragments.type.StarshipPilotsEdge @@ -21,7 +21,7 @@ public object starshipFragmentSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Person", @@ -49,11 +49,11 @@ public object starshipFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "pilotConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected index cff98013fe8..dd61459e06b 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.nested_named_fragments.fragment.selections.starshipFragmentSelections +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Starship import com.example.nested_named_fragments.type.StarshipsConnection import com.example.nested_named_fragments.type.StarshipsEdge @@ -22,7 +22,7 @@ public object AllStarshipsSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Starship", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f7dd1bf60a4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5c06d707f79 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..cf34c424e84 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f144a6ba02a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..b6e95578ab2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/operationBased/nested_named_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected index 76d566c5c87..7dd4b8da754 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/pilotFragmentSelections.kt.expected @@ -8,8 +8,8 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Planet import kotlin.collections.List @@ -17,7 +17,7 @@ public object pilotFragmentSelections { private val homeworld: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Planet", @@ -29,7 +29,7 @@ public object pilotFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "homeworld", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected index 2865b7b0dc7..db1321fa96f 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/planetFragmentSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.nested_named_fragments.type.GraphQLString import kotlin.collections.List public object planetFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected index db0b0502cfe..dd7e2ddb1e9 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/fragment/selections/starshipFragmentSelections.kt.expected @@ -7,11 +7,11 @@ package com.example.nested_named_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.nested_named_fragments.type.GraphQLID +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Person import com.example.nested_named_fragments.type.StarshipPilotsConnection import com.example.nested_named_fragments.type.StarshipPilotsEdge @@ -21,7 +21,7 @@ public object starshipFragmentSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Person", @@ -49,11 +49,11 @@ public object starshipFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "pilotConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected index cff98013fe8..dd61459e06b 100644 --- a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/selections/AllStarshipsSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.nested_named_fragments.fragment.selections.starshipFragmentSelections +import com.example.nested_named_fragments.type.GraphQLString import com.example.nested_named_fragments.type.Starship import com.example.nested_named_fragments.type.StarshipsConnection import com.example.nested_named_fragments.type.StarshipsEdge @@ -22,7 +22,7 @@ public object AllStarshipsSelections { private val node: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Starship", diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f7dd1bf60a4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5c06d707f79 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..cf34c424e84 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..f144a6ba02a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..b6e95578ab2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nested_named_fragments/kotlin/responseBased/nested_named_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nested_named_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/selections/TestQuerySelections.java.expected index eab7fbf075b..0dc4fd73fb7 100644 --- a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/selections/TestQuerySelections.java.expected @@ -6,16 +6,16 @@ package com.example.nonnull.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.nonnull.type.Character; +import com.example.nonnull.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..7090ffdd3c5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..03604889f5f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLID.java.expected new file mode 100644 index 00000000000..3f6fc5ae29f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..daefd7526ae --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLString.java.expected new file mode 100644 index 00000000000..6c1b2a0b487 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/java/operationBased/nonnull/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/selections/TestQuerySelections.kt.expected index 8fe6110bdbb..681658b97f4 100644 --- a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/selections/TestQuerySelections.kt.expected @@ -7,16 +7,16 @@ package com.example.nonnull.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.nonnull.type.Character +import com.example.nonnull.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..4f922a6cb17 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8f2d1cffe98 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..b9f0c174ce8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..ef94c62df91 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0fa0458583a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/nonnull/kotlin/responseBased/nonnull/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.nonnull.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.java.expected index cea34a90269..453ed5ad3f3 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.java.expected @@ -6,13 +6,13 @@ package com.example.not_all_combinations_are_needed.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.not_all_combinations_are_needed.type.GraphQLString; import java.util.Arrays; import java.util.List; public class bFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("fieldB1", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldB1", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.java.expected index 57afd0fae60..1142897961f 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.java.expected @@ -7,28 +7,28 @@ package com.example.not_all_combinations_are_needed.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.not_all_combinations_are_needed.fragment.selections.bFragmentSelections; import com.example.not_all_combinations_are_needed.type.C; +import com.example.not_all_combinations_are_needed.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onB = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "SomeBC")).selections(bFragmentSelections.root).build() ); private static List onA = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("fieldA1", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("fieldA1", GraphQLString.type).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "SomeBC")).selections(onB).build() ); private static List root1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("A", Arrays.asList("ABC")).selections(onA).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..0dab65f3cda --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..f11f95cba0a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLID.java.expected new file mode 100644 index 00000000000..4855abe048a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..4f86103b716 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLString.java.expected new file mode 100644 index 00000000000..0473f388743 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/java/operationBased/not_all_combinations_are_needed/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected index 1b88ee7bc30..a2175844aaf 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.not_all_combinations_are_needed.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.not_all_combinations_are_needed.type.GraphQLString import kotlin.collections.List public object bFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected index e586086dfc3..7d67ff87d43 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.not_all_combinations_are_needed.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.not_all_combinations_are_needed.fragment.selections.bFragmentSelections import com.example.not_all_combinations_are_needed.type.C +import com.example.not_all_combinations_are_needed.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -30,11 +30,11 @@ public object TestQuerySelections { private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -46,7 +46,7 @@ public object TestQuerySelections { private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..05aedce7b3c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ba684d99968 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3d60bd70993 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d13c0a7324a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..7c7612f0683 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/compat/not_all_combinations_are_needed/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected index 1b88ee7bc30..a2175844aaf 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.not_all_combinations_are_needed.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.not_all_combinations_are_needed.type.GraphQLString import kotlin.collections.List public object bFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected index e586086dfc3..7d67ff87d43 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.not_all_combinations_are_needed.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.not_all_combinations_are_needed.fragment.selections.bFragmentSelections import com.example.not_all_combinations_are_needed.type.C +import com.example.not_all_combinations_are_needed.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -30,11 +30,11 @@ public object TestQuerySelections { private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -46,7 +46,7 @@ public object TestQuerySelections { private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..05aedce7b3c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ba684d99968 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3d60bd70993 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d13c0a7324a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..7c7612f0683 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/operationBased/not_all_combinations_are_needed/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected index 1b88ee7bc30..a2175844aaf 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/fragment/selections/bFragmentSelections.kt.expected @@ -7,14 +7,14 @@ package com.example.not_all_combinations_are_needed.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType +import com.example.not_all_combinations_are_needed.type.GraphQLString import kotlin.collections.List public object bFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected index e586086dfc3..7d67ff87d43 100644 --- a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.not_all_combinations_are_needed.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.not_all_combinations_are_needed.fragment.selections.bFragmentSelections import com.example.not_all_combinations_are_needed.type.C +import com.example.not_all_combinations_are_needed.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -30,11 +30,11 @@ public object TestQuerySelections { private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "fieldA1", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -46,7 +46,7 @@ public object TestQuerySelections { private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..05aedce7b3c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..ba684d99968 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3d60bd70993 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d13c0a7324a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..7c7612f0683 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/not_all_combinations_are_needed/kotlin/responseBased/not_all_combinations_are_needed/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.not_all_combinations_are_needed.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/selections/TestQuerySelections.java.expected index 06f4bf9bfcd..6df2a4938b1 100644 --- a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/selections/TestQuerySelections.java.expected @@ -6,17 +6,18 @@ package com.example.operation_id_generator.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.operation_id_generator.type.Character; +import com.example.operation_id_generator.type.GraphQLID; +import com.example.operation_id_generator.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..61c049f8f4f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..592ccefedd2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLID.java.expected new file mode 100644 index 00000000000..f31bda50170 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..5c4ab1b8f37 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLString.java.expected new file mode 100644 index 00000000000..e3efe2e26ae --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/java/operationBased/operation_id_generator/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/selections/TestQuerySelections.kt.expected index b65ee00e6c4..fb5342af986 100644 --- a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/selections/TestQuerySelections.kt.expected @@ -6,22 +6,22 @@ package com.example.operation_id_generator.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.operation_id_generator.type.Character +import com.example.operation_id_generator.type.GraphQLID +import com.example.operation_id_generator.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..1e846a48fde --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..eeb57bbdbb9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..b3ff9d64188 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..4de962e131c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3978fda24a4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/operation_id_generator/kotlin/responseBased/operation_id_generator/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.operation_id_generator.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/selections/TestQuerySelections.java.expected index 504bc876047..c0a398f2044 100644 --- a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/selections/TestQuerySelections.java.expected @@ -6,18 +6,18 @@ package com.example.optional.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.optional.type.Character; import com.example.optional.type.Episode; +import com.example.optional.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("appearsIn", new CompiledNotNullType(new CompiledListType(Episode.type))).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..5ed645bd8bf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..8b6a474f477 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLID.java.expected new file mode 100644 index 00000000000..6c8c46c40e2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..3442833569b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLString.java.expected new file mode 100644 index 00000000000..0685c204c44 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/java/operationBased/optional/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/selections/TestQuerySelections.kt.expected index c26858dc72c..d8befea77c5 100644 --- a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/selections/TestQuerySelections.kt.expected @@ -7,18 +7,18 @@ package com.example.optional.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.optional.type.Character import com.example.optional.type.Episode +import com.example.optional.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "appearsIn", diff --git a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..53a99066e5c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..652af4fc17f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..0a960733021 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1f4cd67b53d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..e4099951369 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/optional/kotlin/responseBased/optional/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.optional.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.java.expected index fb5a2bc1c21..73246356fea 100644 --- a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.java.expected @@ -7,29 +7,29 @@ package com.example.path_vs_flat_accessors.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.path_vs_flat_accessors.type.C; +import com.example.path_vs_flat_accessors.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onB = Arrays.asList( - new CompiledField.Builder("fieldB1", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldB1", GraphQLString.type).build() ); private static List onA = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "BC")).selections(onB).build() ); private static List onB1 = Arrays.asList( - new CompiledField.Builder("fieldB2", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("fieldB2", GraphQLString.type).build() ); private static List root1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("A", Arrays.asList("ABC", "AC")).selections(onA).build(), new CompiledFragment.Builder("B", Arrays.asList("ABC", "BC")).selections(onB1).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..766c2606d20 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..a1ca822bb3e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLID.java.expected new file mode 100644 index 00000000000..6f019b4284a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..f0e0843eaaa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLString.java.expected new file mode 100644 index 00000000000..41df7e68baa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/java/operationBased/path_vs_flat_accessors/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected index 3a6a697b0bc..076561fcc7b 100644 --- a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected @@ -8,23 +8,23 @@ package com.example.path_vs_flat_accessors.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.path_vs_flat_accessors.type.C +import com.example.path_vs_flat_accessors.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -36,14 +36,14 @@ public object TestQuerySelections { private val onB1: List = listOf( CompiledField.Builder( name = "fieldB2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..68b9f6f290b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..03abf90c02e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..49ff2972b15 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1d951d1a8ac --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fa638bc6bc7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/compat/path_vs_flat_accessors/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected index 3a6a697b0bc..076561fcc7b 100644 --- a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected @@ -8,23 +8,23 @@ package com.example.path_vs_flat_accessors.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.path_vs_flat_accessors.type.C +import com.example.path_vs_flat_accessors.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -36,14 +36,14 @@ public object TestQuerySelections { private val onB1: List = listOf( CompiledField.Builder( name = "fieldB2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..68b9f6f290b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..03abf90c02e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..49ff2972b15 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1d951d1a8ac --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fa638bc6bc7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/operationBased/path_vs_flat_accessors/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected index 3a6a697b0bc..076561fcc7b 100644 --- a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/selections/TestQuerySelections.kt.expected @@ -8,23 +8,23 @@ package com.example.path_vs_flat_accessors.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.path_vs_flat_accessors.type.C +import com.example.path_vs_flat_accessors.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onB: List = listOf( CompiledField.Builder( name = "fieldB1", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val onA: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "B", @@ -36,14 +36,14 @@ public object TestQuerySelections { private val onB1: List = listOf( CompiledField.Builder( name = "fieldB2", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val root1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "A", diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..68b9f6f290b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..03abf90c02e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..49ff2972b15 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1d951d1a8ac --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fa638bc6bc7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/path_vs_flat_accessors/kotlin/responseBased/path_vs_flat_accessors/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.path_vs_flat_accessors.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/selections/TestQuerySelections.java.expected index e093b603645..19785cc0526 100644 --- a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/selections/TestQuerySelections.java.expected @@ -6,25 +6,25 @@ package com.example.recursive_selection.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.recursive_selection.type.GraphQLString; import com.example.recursive_selection.type.Tree; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List children = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List parent = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List tree = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("children", new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Tree.type)))).selections(children).build(), new CompiledField.Builder("parent", Tree.type).selections(parent).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..2306e16076b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..d2698621d7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLID.java.expected new file mode 100644 index 00000000000..51f15236c84 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..d242db714b2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLString.java.expected new file mode 100644 index 00000000000..fe1b7f0ddb0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/java/operationBased/recursive_selection/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/selections/TestQuerySelections.kt.expected index 4a9ce84dd65..7c8ba5b531d 100644 --- a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/selections/TestQuerySelections.kt.expected @@ -7,9 +7,9 @@ package com.example.recursive_selection.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.recursive_selection.type.GraphQLString import com.example.recursive_selection.type.Tree import kotlin.collections.List @@ -17,21 +17,21 @@ public object TestQuerySelections { private val children: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val parent: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val tree: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "children", diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..1263f074f28 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..614ec7ee77c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..445949942fd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..d11e81d546c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..4d80d108893 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/recursive_selection/kotlin/responseBased/recursive_selection/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.recursive_selection.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/selections/TestQuerySelections.java.expected index d5c113bc630..7e046177bd0 100644 --- a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/selections/TestQuerySelections.java.expected @@ -8,27 +8,28 @@ package com.example.reserved_keywords.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.reserved_keywords.type.Character; +import com.example.reserved_keywords.type.GraphQLID; +import com.example.reserved_keywords.type.GraphQLString; import com.example.reserved_keywords.type.SearchResult; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List yield = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).alias("while").build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).alias("it").build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).alias("while").build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).alias("it").build() ); private static List onCharacter = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List objects = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..aeba0008561 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..9e7807e9bb2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLID.java.expected new file mode 100644 index 00000000000..100ad0f0307 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..a535ba89164 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLString.java.expected new file mode 100644 index 00000000000..f15f2b09e88 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/java/operationBased/reserved_keywords/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/selections/TestQuerySelections.kt.expected index 44194bfceb8..615f29d3a58 100644 --- a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.reserved_keywords.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.reserved_keywords.type.Character +import com.example.reserved_keywords.type.GraphQLID +import com.example.reserved_keywords.type.GraphQLString import com.example.reserved_keywords.type.SearchResult import kotlin.collections.List @@ -21,12 +21,12 @@ public object TestQuerySelections { private val `yield`: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).alias("while") .build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).alias("it") .build() ) @@ -34,14 +34,14 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val objects: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..97857f96cfa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..f4b230aa21d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4513403b200 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..ebe868cb22b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..4d986265124 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/compat/reserved_keywords/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/selections/TestQuerySelections.kt.expected index 44194bfceb8..615f29d3a58 100644 --- a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.reserved_keywords.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.reserved_keywords.type.Character +import com.example.reserved_keywords.type.GraphQLID +import com.example.reserved_keywords.type.GraphQLString import com.example.reserved_keywords.type.SearchResult import kotlin.collections.List @@ -21,12 +21,12 @@ public object TestQuerySelections { private val `yield`: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).alias("while") .build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).alias("it") .build() ) @@ -34,14 +34,14 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val objects: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..97857f96cfa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..f4b230aa21d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4513403b200 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..ebe868cb22b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..4d986265124 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/operationBased/reserved_keywords/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/selections/TestQuerySelections.kt.expected index 44194bfceb8..615f29d3a58 100644 --- a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.reserved_keywords.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.reserved_keywords.type.Character +import com.example.reserved_keywords.type.GraphQLID +import com.example.reserved_keywords.type.GraphQLString import com.example.reserved_keywords.type.SearchResult import kotlin.collections.List @@ -21,12 +21,12 @@ public object TestQuerySelections { private val `yield`: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).alias("while") .build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).alias("it") .build() ) @@ -34,14 +34,14 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val objects: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..97857f96cfa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..f4b230aa21d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4513403b200 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..ebe868cb22b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..4d986265124 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/reserved_keywords/kotlin/responseBased/reserved_keywords/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.reserved_keywords.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.java.expected index d41351e648b..9f6f4abc3c7 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.java.expected @@ -6,20 +6,20 @@ package com.example.root_query_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.root_query_fragment.type.Character; +import com.example.root_query_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class QueryFragmentSelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("hero", Character.type).selections(hero).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/selections/TestQuerySelections.java.expected index 0f21affc52e..c11ca945e18 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/selections/TestQuerySelections.java.expected @@ -7,16 +7,16 @@ package com.example.root_query_fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.root_query_fragment.fragment.selections.QueryFragmentSelections; +import com.example.root_query_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Query", Arrays.asList("Query")).selections(QueryFragmentSelections.root).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..7f5510ea83d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..a2fac4de019 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..5c3bc0ab5ce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..daadc392834 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..435a3f3152f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/java/operationBased/root_query_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected index 2d3fed66757..f02fc7d0516 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected @@ -7,23 +7,23 @@ package com.example.root_query_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment.type.Character +import com.example.root_query_fragment.type.GraphQLString import kotlin.collections.List public object QueryFragmentSelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/selections/TestQuerySelections.kt.expected index 0df40419ab5..9d1838b31ec 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/selections/TestQuerySelections.kt.expected @@ -8,16 +8,16 @@ package com.example.root_query_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment.fragment.selections.QueryFragmentSelections +import com.example.root_query_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..8a55c41d02d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..800f6e2dc29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3216500451d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2b8b63c88fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..d92e48e6efa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/compat/root_query_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected index 2d3fed66757..f02fc7d0516 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected @@ -7,23 +7,23 @@ package com.example.root_query_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment.type.Character +import com.example.root_query_fragment.type.GraphQLString import kotlin.collections.List public object QueryFragmentSelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/selections/TestQuerySelections.kt.expected index 0df40419ab5..9d1838b31ec 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/selections/TestQuerySelections.kt.expected @@ -8,16 +8,16 @@ package com.example.root_query_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment.fragment.selections.QueryFragmentSelections +import com.example.root_query_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..8a55c41d02d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..800f6e2dc29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3216500451d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2b8b63c88fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..d92e48e6efa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/operationBased/root_query_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected index 2d3fed66757..f02fc7d0516 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/fragment/selections/QueryFragmentSelections.kt.expected @@ -7,23 +7,23 @@ package com.example.root_query_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment.type.Character +import com.example.root_query_fragment.type.GraphQLString import kotlin.collections.List public object QueryFragmentSelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/selections/TestQuerySelections.kt.expected index 0df40419ab5..9d1838b31ec 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/selections/TestQuerySelections.kt.expected @@ -8,16 +8,16 @@ package com.example.root_query_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment.fragment.selections.QueryFragmentSelections +import com.example.root_query_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..8a55c41d02d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..800f6e2dc29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3216500451d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2b8b63c88fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..d92e48e6efa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment/kotlin/responseBased/root_query_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.java.expected index ec73dd5d6c9..602b60f11a6 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.java.expected @@ -8,38 +8,38 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.root_query_fragment_with_nested_fragments.type.Character; import com.example.root_query_fragment_with_nested_fragments.type.Droid; +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString; import com.example.root_query_fragment_with_nested_fragments.type.Human; import java.util.Arrays; import java.util.List; public class QueryFragmentSelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(heroFragmentSelections.root).build() ); private static List droid = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(droidFragmentSelections.root).build() ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("homePlanet", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("homePlanet", GraphQLString.type).build() ); private static List human = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("hero", Character.type).selections(hero).build(), new CompiledField.Builder("droid", Droid.type).arguments(Arrays.asList(new CompiledArgument("id", 1, false))).selections(droid).build(), new CompiledField.Builder("human", Human.type).arguments(Arrays.asList(new CompiledArgument("id", 1, false))).selections(human).build() diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.java.expected index cd895c7b9ce..520aadf8cf4 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.java.expected @@ -6,15 +6,15 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class droidFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.java.expected index d87a005ff09..12a5f3f1426 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.java.expected @@ -6,14 +6,14 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class heroFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.java.expected index 19547eba9f4..e4fc1c5ff57 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.java.expected @@ -7,16 +7,16 @@ package com.example.root_query_fragment_with_nested_fragments.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.root_query_fragment_with_nested_fragments.fragment.selections.QueryFragmentSelections; +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Query", Arrays.asList("Query")).selections(QueryFragmentSelections.root).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..c2e9bb58fcc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..419fb08441a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLID.java.expected new file mode 100644 index 00000000000..fd2b7934cb6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..c1a8b369014 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLString.java.expected new file mode 100644 index 00000000000..04720ccbd69 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/java/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected index da400f203c5..5055de997a6 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment_with_nested_fragments.type.Character import com.example.root_query_fragment_with_nested_fragments.type.Droid +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import com.example.root_query_fragment_with_nested_fragments.type.Human import kotlin.collections.List @@ -20,7 +20,7 @@ public object QueryFragmentSelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -32,7 +32,7 @@ public object QueryFragmentSelections { private val droid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -44,18 +44,18 @@ public object QueryFragmentSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val human: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -67,7 +67,7 @@ public object QueryFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected index 880172a9732..16709c4fea4 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object droidFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected index 7c3a47e2a52..583eae9a4bd 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object heroFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected index 8431e2199da..fe0287cba39 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected @@ -8,16 +8,16 @@ package com.example.root_query_fragment_with_nested_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment_with_nested_fragments.fragment.selections.QueryFragmentSelections +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..6e8ef0464fe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5cb70515215 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f6335fc7a7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..92cf6250ad7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3f45d1cd836 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/compat/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected index da400f203c5..5055de997a6 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment_with_nested_fragments.type.Character import com.example.root_query_fragment_with_nested_fragments.type.Droid +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import com.example.root_query_fragment_with_nested_fragments.type.Human import kotlin.collections.List @@ -20,7 +20,7 @@ public object QueryFragmentSelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -32,7 +32,7 @@ public object QueryFragmentSelections { private val droid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -44,18 +44,18 @@ public object QueryFragmentSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val human: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -67,7 +67,7 @@ public object QueryFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected index 880172a9732..16709c4fea4 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object droidFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected index 7c3a47e2a52..583eae9a4bd 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object heroFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected index 8431e2199da..fe0287cba39 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected @@ -8,16 +8,16 @@ package com.example.root_query_fragment_with_nested_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment_with_nested_fragments.fragment.selections.QueryFragmentSelections +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..6e8ef0464fe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5cb70515215 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f6335fc7a7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..92cf6250ad7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3f45d1cd836 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/operationBased/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected index da400f203c5..5055de997a6 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/QueryFragmentSelections.kt.expected @@ -9,10 +9,10 @@ import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment_with_nested_fragments.type.Character import com.example.root_query_fragment_with_nested_fragments.type.Droid +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import com.example.root_query_fragment_with_nested_fragments.type.Human import kotlin.collections.List @@ -20,7 +20,7 @@ public object QueryFragmentSelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -32,7 +32,7 @@ public object QueryFragmentSelections { private val droid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -44,18 +44,18 @@ public object QueryFragmentSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val human: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -67,7 +67,7 @@ public object QueryFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected index 880172a9732..16709c4fea4 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/droidFragmentSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object droidFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected index 7c3a47e2a52..583eae9a4bd 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/fragment/selections/heroFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.root_query_fragment_with_nested_fragments.fragment.selection import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object heroFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected index 8431e2199da..fe0287cba39 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/selections/TestQuerySelections.kt.expected @@ -8,16 +8,16 @@ package com.example.root_query_fragment_with_nested_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.root_query_fragment_with_nested_fragments.fragment.selections.QueryFragmentSelections +import com.example.root_query_fragment_with_nested_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..6e8ef0464fe --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..5cb70515215 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..f6335fc7a7d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..92cf6250ad7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3f45d1cd836 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_fragment_with_nested_fragments/kotlin/responseBased/root_query_fragment_with_nested_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_fragment_with_nested_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/selections/TestQuerySelections.java.expected index 5cb5e67c133..145988519e7 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/selections/TestQuerySelections.java.expected @@ -8,46 +8,47 @@ package com.example.root_query_inline_fragment.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.root_query_inline_fragment.type.Character; import com.example.root_query_inline_fragment.type.Droid; import com.example.root_query_inline_fragment.type.Episode; +import com.example.root_query_inline_fragment.type.GraphQLFloat; +import com.example.root_query_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("height", GraphQLFloat.type).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("appearsIn", new CompiledNotNullType(new CompiledListType(Episode.type))).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List droid = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); private static List onQuery = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("hero", Character.type).selections(hero).build(), new CompiledField.Builder("droid", Droid.type).arguments(Arrays.asList(new CompiledArgument("id", 1, false))).selections(droid).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Query", Arrays.asList("Query")).selections(onQuery).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..f18ed164803 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..fa47b51ead7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..98056276bf9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..95f9a48f6b3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..680f4078a10 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/java/operationBased/root_query_inline_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/selections/TestQuerySelections.kt.expected index 3837c2bbc51..70dc036ba09 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/selections/TestQuerySelections.kt.expected @@ -7,33 +7,33 @@ package com.example.root_query_inline_fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.root_query_inline_fragment.type.Character import com.example.root_query_inline_fragment.type.Droid import com.example.root_query_inline_fragment.type.Episode +import com.example.root_query_inline_fragment.type.GraphQLFloat +import com.example.root_query_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "appearsIn", @@ -49,18 +49,18 @@ public object TestQuerySelections { private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val droid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -72,7 +72,7 @@ public object TestQuerySelections { private val onQuery: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", @@ -92,7 +92,7 @@ public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..658a95b640a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..7d907513cc8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8720d160b48 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..57546cfee7b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..81cddf63e7f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/compat/root_query_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected index 3837c2bbc51..70dc036ba09 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected @@ -7,33 +7,33 @@ package com.example.root_query_inline_fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.root_query_inline_fragment.type.Character import com.example.root_query_inline_fragment.type.Droid import com.example.root_query_inline_fragment.type.Episode +import com.example.root_query_inline_fragment.type.GraphQLFloat +import com.example.root_query_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "appearsIn", @@ -49,18 +49,18 @@ public object TestQuerySelections { private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val droid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -72,7 +72,7 @@ public object TestQuerySelections { private val onQuery: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", @@ -92,7 +92,7 @@ public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..658a95b640a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..7d907513cc8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8720d160b48 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..57546cfee7b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..81cddf63e7f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/operationBased/root_query_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected index 3837c2bbc51..70dc036ba09 100644 --- a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/selections/TestQuerySelections.kt.expected @@ -7,33 +7,33 @@ package com.example.root_query_inline_fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.root_query_inline_fragment.type.Character import com.example.root_query_inline_fragment.type.Droid import com.example.root_query_inline_fragment.type.Episode +import com.example.root_query_inline_fragment.type.GraphQLFloat +import com.example.root_query_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "appearsIn", @@ -49,18 +49,18 @@ public object TestQuerySelections { private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val droid: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Droid", @@ -72,7 +72,7 @@ public object TestQuerySelections { private val onQuery: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "hero", @@ -92,7 +92,7 @@ public object TestQuerySelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Query", diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..658a95b640a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..7d907513cc8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8720d160b48 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..57546cfee7b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..81cddf63e7f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/root_query_inline_fragment/kotlin/responseBased/root_query_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.root_query_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.java.expected index 76c6fc9860b..3911564ade1 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.java.expected @@ -7,15 +7,15 @@ package com.example.simple_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.simple_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.java.expected index b10306b4bbd..0c34084673c 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.java.expected @@ -6,15 +6,15 @@ package com.example.simple_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.simple_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HumanDetailsSelections { public static List root = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/selections/TestQuerySelections.java.expected index 86ce63a4703..e08688a130c 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/selections/TestQuerySelections.java.expected @@ -7,18 +7,18 @@ package com.example.simple_fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.simple_fragment.fragment.selections.HeroDetailsSelections; import com.example.simple_fragment.fragment.selections.HumanDetailsSelections; import com.example.simple_fragment.type.Character; +import com.example.simple_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(HeroDetailsSelections.root).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(HumanDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..25035c39df2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..a577d1a3748 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..b66d1562558 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..ce887d3321f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..b79d4db5b25 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/java/operationBased/simple_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected index 066bcf04e92..bfb2fc876af 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected @@ -8,15 +8,15 @@ package com.example.simple_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected index aae200b54e2..2337fbd7945 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.simple_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/selections/TestQuerySelections.kt.expected index 1a8aefe6f83..8dc8347ce1e 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.simple_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_fragment.fragment.selections.HeroDetailsSelections import com.example.simple_fragment.fragment.selections.HumanDetailsSelections import com.example.simple_fragment.type.Character +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..0e5be2ecd9f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +internal class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8499dda723d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +internal class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4c0cb5304e5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +internal class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2cf0b35798c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +internal class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..a3c570d3d4f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/compat/simple_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +internal class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected index 066bcf04e92..bfb2fc876af 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected @@ -8,15 +8,15 @@ package com.example.simple_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected index aae200b54e2..2337fbd7945 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.simple_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/selections/TestQuerySelections.kt.expected index 1a8aefe6f83..8dc8347ce1e 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.simple_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_fragment.fragment.selections.HeroDetailsSelections import com.example.simple_fragment.fragment.selections.HumanDetailsSelections import com.example.simple_fragment.type.Character +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..0e5be2ecd9f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +internal class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8499dda723d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +internal class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4c0cb5304e5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +internal class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2cf0b35798c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +internal class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..a3c570d3d4f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/operationBased/simple_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +internal class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected index 066bcf04e92..bfb2fc876af 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HeroDetailsSelections.kt.expected @@ -8,15 +8,15 @@ package com.example.simple_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected index aae200b54e2..2337fbd7945 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/fragment/selections/HumanDetailsSelections.kt.expected @@ -7,19 +7,19 @@ package com.example.simple_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object HumanDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/selections/TestQuerySelections.kt.expected index 1a8aefe6f83..8dc8347ce1e 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/selections/TestQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.simple_fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_fragment.fragment.selections.HeroDetailsSelections import com.example.simple_fragment.fragment.selections.HumanDetailsSelections import com.example.simple_fragment.type.Character +import com.example.simple_fragment.type.GraphQLString import kotlin.collections.List internal object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..0e5be2ecd9f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +internal class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..8499dda723d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +internal class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4c0cb5304e5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +internal class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2cf0b35798c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +internal class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..a3c570d3d4f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment/kotlin/responseBased/simple_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +internal class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.java.expected index 27fc847dd7b..402bedeb607 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.java.expected @@ -7,32 +7,33 @@ package com.example.simple_fragment_with_inline_fragments.fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.simple_fragment_with_inline_fragments.type.Character; +import com.example.simple_fragment_with_inline_fragments.type.GraphQLFloat; +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("height", GraphQLFloat.type).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List friends = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.java.expected index c079995465c..1f506333065 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.java.expected @@ -7,17 +7,17 @@ package com.example.simple_fragment_with_inline_fragments.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.simple_fragment_with_inline_fragments.fragment.selections.HeroDetailsSelections; import com.example.simple_fragment_with_inline_fragments.type.Character; +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(HeroDetailsSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..bd73f584872 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..e149e39fbf5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLID.java.expected new file mode 100644 index 00000000000..c66c3d2fa4e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..f87e8a0449f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLString.java.expected new file mode 100644 index 00000000000..539ebc41321 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/java/operationBased/simple_fragment_with_inline_fragments/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected index f88a1a7126c..e5160cc418a 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,38 +6,38 @@ package com.example.simple_fragment_with_inline_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.simple_fragment_with_inline_fragments.type.Character +import com.example.simple_fragment_with_inline_fragments.type.GraphQLFloat +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -54,7 +54,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected index 93043d71739..51dc7202386 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.simple_fragment_with_inline_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_fragment_with_inline_fragments.fragment.selections.HeroDetailsSelections import com.example.simple_fragment_with_inline_fragments.type.Character +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ae146a80d6d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d71afa15f9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..6d73a467440 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2dd30d1c616 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..8f459329caf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/compat/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected index f88a1a7126c..e5160cc418a 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,38 +6,38 @@ package com.example.simple_fragment_with_inline_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.simple_fragment_with_inline_fragments.type.Character +import com.example.simple_fragment_with_inline_fragments.type.GraphQLFloat +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -54,7 +54,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected index 93043d71739..51dc7202386 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.simple_fragment_with_inline_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_fragment_with_inline_fragments.fragment.selections.HeroDetailsSelections import com.example.simple_fragment_with_inline_fragments.type.Character +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ae146a80d6d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d71afa15f9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..6d73a467440 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2dd30d1c616 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..8f459329caf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/operationBased/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected index f88a1a7126c..e5160cc418a 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,38 +6,38 @@ package com.example.simple_fragment_with_inline_fragments.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.simple_fragment_with_inline_fragments.type.Character +import com.example.simple_fragment_with_inline_fragments.type.GraphQLFloat +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -54,7 +54,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected index 93043d71739..51dc7202386 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.simple_fragment_with_inline_fragments.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_fragment_with_inline_fragments.fragment.selections.HeroDetailsSelections import com.example.simple_fragment_with_inline_fragments.type.Character +import com.example.simple_fragment_with_inline_fragments.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..ae146a80d6d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d71afa15f9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..6d73a467440 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2dd30d1c616 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..8f459329caf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_fragment_with_inline_fragments/kotlin/responseBased/simple_fragment_with_inline_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_fragment_with_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/selections/TestQuerySelections.java.expected index 4d3b36efe87..fc7ccadd293 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/selections/TestQuerySelections.java.expected @@ -7,34 +7,36 @@ package com.example.simple_inline_fragment.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.simple_inline_fragment.type.Character; +import com.example.simple_inline_fragment.type.GraphQLFloat; +import com.example.simple_inline_fragment.type.GraphQLID; +import com.example.simple_inline_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onCharacter1 = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List onCharacter = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter1).build() ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build() + new CompiledField.Builder("height", GraphQLFloat.type).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..74b5a1439f6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..2a129bbccaa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..ecbe46cc5de --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..74d95b8fb6c --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..3fea7ae45f0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/java/operationBased/simple_inline_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/selections/TestQuerySelections.kt.expected index 69df737fdde..780dd74c273 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/selections/TestQuerySelections.kt.expected @@ -6,31 +6,31 @@ package com.example.simple_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_inline_fragment.type.Character +import com.example.simple_inline_fragment.type.GraphQLFloat +import com.example.simple_inline_fragment.type.GraphQLID +import com.example.simple_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onCharacter1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -42,21 +42,21 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b00b519964d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..075ff3cac2e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4dcc66b8e01 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..b1efefee2d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3ffbf7076ab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/compat/simple_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected index 69df737fdde..780dd74c273 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected @@ -6,31 +6,31 @@ package com.example.simple_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_inline_fragment.type.Character +import com.example.simple_inline_fragment.type.GraphQLFloat +import com.example.simple_inline_fragment.type.GraphQLID +import com.example.simple_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onCharacter1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -42,21 +42,21 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b00b519964d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..075ff3cac2e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4dcc66b8e01 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..b1efefee2d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3ffbf7076ab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/operationBased/simple_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected index 69df737fdde..780dd74c273 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/selections/TestQuerySelections.kt.expected @@ -6,31 +6,31 @@ package com.example.simple_inline_fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_inline_fragment.type.Character +import com.example.simple_inline_fragment.type.GraphQLFloat +import com.example.simple_inline_fragment.type.GraphQLID +import com.example.simple_inline_fragment.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onCharacter1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onCharacter: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -42,21 +42,21 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b00b519964d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..075ff3cac2e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..4dcc66b8e01 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..b1efefee2d4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..3ffbf7076ab --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_inline_fragment/kotlin/responseBased/simple_inline_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_inline_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/CatFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/CatFragmentSelections.java.expected index 8ed67c8b86e..cf0feaa8092 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/CatFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/CatFragmentSelections.java.expected @@ -6,14 +6,14 @@ package com.example.simple_union.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.simple_union.type.GraphQLString; import java.util.Arrays; import java.util.List; public class CatFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("meow", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("meow", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/DogFragmentSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/DogFragmentSelections.java.expected index 209af96c2f3..72a4a8af36b 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/DogFragmentSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/fragment/selections/DogFragmentSelections.java.expected @@ -6,14 +6,14 @@ package com.example.simple_union.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.simple_union.type.GraphQLString; import java.util.Arrays; import java.util.List; public class DogFragmentSelections { public static List root = Arrays.asList( - new CompiledField.Builder("woof", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("woof", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/selections/AnimalQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/selections/AnimalQuerySelections.java.expected index e1f0f5dd096..16a3abf511e 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/selections/AnimalQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/selections/AnimalQuerySelections.java.expected @@ -7,18 +7,18 @@ package com.example.simple_union.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.simple_union.fragment.selections.CatFragmentSelections; import com.example.simple_union.fragment.selections.DogFragmentSelections; import com.example.simple_union.type.Animal; +import com.example.simple_union.type.GraphQLString; import java.util.Arrays; import java.util.List; public class AnimalQuerySelections { private static List animal = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Cat", Arrays.asList("Cat")).selections(CatFragmentSelections.root).build(), new CompiledFragment.Builder("Dog", Arrays.asList("Dog")).selections(DogFragmentSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..891c4affbfd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..a4d52199440 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLID.java.expected new file mode 100644 index 00000000000..8e5e936308a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..d2e9e6b084e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLString.java.expected new file mode 100644 index 00000000000..2b3f97c24b9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/java/operationBased/simple_union/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/CatFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/CatFragmentSelections.kt.expected index b082ccf5b53..e27d1484835 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/CatFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/CatFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.simple_union.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object CatFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "meow", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/DogFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/DogFragmentSelections.kt.expected index 34dacbc4ba4..d6da488ad11 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/DogFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/fragment/selections/DogFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.simple_union.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object DogFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "woof", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/selections/AnimalQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/selections/AnimalQuerySelections.kt.expected index caddbe6f8f5..e4a39de4bd9 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/selections/AnimalQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/selections/AnimalQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.simple_union.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_union.fragment.selections.CatFragmentSelections import com.example.simple_union.fragment.selections.DogFragmentSelections import com.example.simple_union.type.Animal +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object AnimalQuerySelections { private val animal: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Cat", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..11399ddef85 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..cfa5d53d148 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..287fd36878b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..5ee3b1b25f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..df289b04b49 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/compat/simple_union/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected index b082ccf5b53..e27d1484835 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.simple_union.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object CatFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "meow", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected index 34dacbc4ba4..d6da488ad11 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.simple_union.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object DogFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "woof", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/selections/AnimalQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/selections/AnimalQuerySelections.kt.expected index caddbe6f8f5..e4a39de4bd9 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/selections/AnimalQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/selections/AnimalQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.simple_union.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_union.fragment.selections.CatFragmentSelections import com.example.simple_union.fragment.selections.DogFragmentSelections import com.example.simple_union.type.Animal +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object AnimalQuerySelections { private val animal: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Cat", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..11399ddef85 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..cfa5d53d148 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..287fd36878b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..5ee3b1b25f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..df289b04b49 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/operationBased/simple_union/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected index b082ccf5b53..e27d1484835 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/CatFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.simple_union.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object CatFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "meow", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected index 34dacbc4ba4..d6da488ad11 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/fragment/selections/DogFragmentSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.simple_union.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object DogFragmentSelections { public val root: List = listOf( CompiledField.Builder( name = "woof", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/selections/AnimalQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/selections/AnimalQuerySelections.kt.expected index caddbe6f8f5..e4a39de4bd9 100644 --- a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/selections/AnimalQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/selections/AnimalQuerySelections.kt.expected @@ -8,18 +8,18 @@ package com.example.simple_union.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.simple_union.fragment.selections.CatFragmentSelections import com.example.simple_union.fragment.selections.DogFragmentSelections import com.example.simple_union.type.Animal +import com.example.simple_union.type.GraphQLString import kotlin.collections.List public object AnimalQuerySelections { private val animal: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Cat", diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..11399ddef85 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..cfa5d53d148 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..287fd36878b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..5ee3b1b25f7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..df289b04b49 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/simple_union/kotlin/responseBased/simple_union/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.simple_union.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/selections/TestQuerySelections.java.expected index 0fa627c3979..497bf987f45 100644 --- a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/selections/TestQuerySelections.java.expected @@ -7,20 +7,22 @@ package com.example.starships.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; +import com.example.starships.type.GraphQLFloat; +import com.example.starships.type.GraphQLID; +import com.example.starships.type.GraphQLString; import com.example.starships.type.Starship; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List starship = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("coordinates", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(CompiledGraphQL.CompiledFloatType))))).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("coordinates", new CompiledListType(new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(GraphQLFloat.type))))).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..21324276ba6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..46a42b562cb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLID.java.expected new file mode 100644 index 00000000000..fda04895dea --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..5e3e324a419 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLString.java.expected new file mode 100644 index 00000000000..fb7ce5d5e46 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/java/operationBased/starships/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/selections/TestQuerySelections.kt.expected index e46efe3c47f..58b38286326 100644 --- a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/selections/TestQuerySelections.kt.expected @@ -7,13 +7,13 @@ package com.example.starships.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull +import com.example.starships.type.GraphQLFloat +import com.example.starships.type.GraphQLID +import com.example.starships.type.GraphQLString import com.example.starships.type.Starship import kotlin.collections.List @@ -21,15 +21,15 @@ public object TestQuerySelections { private val starship: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "coordinates", - type = CompiledFloatType.notNull().list().notNull().list() + type = GraphQLFloat.type.notNull().list().notNull().list() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..e4cfb89d601 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..4dab08105ec --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..8f8bda5f8b2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..7ad48e06d64 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..fe017a820fa --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/starships/kotlin/responseBased/starships/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.starships.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/selections/TestSubscriptionSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/selections/TestSubscriptionSelections.java.expected index 5f23014391c..d66bd9fa2e8 100644 --- a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/selections/TestSubscriptionSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/selections/TestSubscriptionSelections.java.expected @@ -7,18 +7,19 @@ package com.example.subscriptions.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.example.subscriptions.type.Comment; +import com.example.subscriptions.type.GraphQLInt; +import com.example.subscriptions.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestSubscriptionSelections { private static List commentAdded = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIntType)).build(), - new CompiledField.Builder("content", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLInt.type)).build(), + new CompiledField.Builder("content", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..6320a58dc78 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..0dcb5c935b0 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLID.java.expected new file mode 100644 index 00000000000..088dc66c46e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..a6d1d981e4a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLString.java.expected new file mode 100644 index 00000000000..de04611e4c5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/java/operationBased/subscriptions/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/selections/TestSubscriptionSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/selections/TestSubscriptionSelections.kt.expected index 423f6e52113..d4619e1120b 100644 --- a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/selections/TestSubscriptionSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/selections/TestSubscriptionSelections.kt.expected @@ -7,23 +7,23 @@ package com.example.subscriptions.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull import com.example.subscriptions.type.Comment +import com.example.subscriptions.type.GraphQLInt +import com.example.subscriptions.type.GraphQLString import kotlin.collections.List public object TestSubscriptionSelections { private val commentAdded: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIntType.notNull() + type = GraphQLInt.type.notNull() ).build(), CompiledField.Builder( name = "content", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..90ddd910f7b --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..9f8bcf37155 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..9651bec59a1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..26cb076a862 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..d03c56b2f9a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/subscriptions/kotlin/responseBased/subscriptions/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.subscriptions.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/selections/GetPageSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/selections/GetPageSelections.java.expected index cc7246ebd96..6f8ddeeb02d 100644 --- a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/selections/GetPageSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/selections/GetPageSelections.java.expected @@ -7,26 +7,26 @@ package com.example.test_inline.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.test_inline.type.Collection; +import com.example.test_inline.type.GraphQLString; import com.example.test_inline.type.Item; import java.util.Arrays; import java.util.List; public class GetPageSelections { private static List items = Arrays.asList( - new CompiledField.Builder("title", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("title", new CompiledNotNullType(GraphQLString.type)).build() ); private static List onParticularItem = Arrays.asList( - new CompiledField.Builder("image", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("image", new CompiledNotNullType(GraphQLString.type)).build() ); private static List items1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("ParticularItem", Arrays.asList("ParticularItem")).selections(onParticularItem).build() ); @@ -35,7 +35,7 @@ public class GetPageSelections { ); private static List collection = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("items", new CompiledNotNullType(new CompiledListType(new CompiledNotNullType(Item.type)))).selections(items).build(), new CompiledFragment.Builder("ParticularCollection", Arrays.asList("ParticularCollection")).selections(onParticularCollection).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..fe75c3a90e5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..df18d2f0974 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLID.java.expected new file mode 100644 index 00000000000..ddf75460b28 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..4f2ca2f5652 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLString.java.expected new file mode 100644 index 00000000000..18b717f00c9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/java/operationBased/test_inline/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/selections/GetPageSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/selections/GetPageSelections.kt.expected index 3adebae5dac..b4eda743030 100644 --- a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/selections/GetPageSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/selections/GetPageSelections.kt.expected @@ -8,10 +8,10 @@ package com.example.test_inline.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.test_inline.type.Collection +import com.example.test_inline.type.GraphQLString import com.example.test_inline.type.Item import kotlin.collections.List @@ -19,21 +19,21 @@ public object GetPageSelections { private val items: List = listOf( CompiledField.Builder( name = "title", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onParticularItem: List = listOf( CompiledField.Builder( name = "image", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val items1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "ParticularItem", @@ -53,7 +53,7 @@ public object GetPageSelections { private val collection: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "items", diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b224cc410f5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..37a2f854941 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..95edbed966e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..54d6adda20d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..2817333b5cd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/compat/test_inline/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/selections/GetPageSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/selections/GetPageSelections.kt.expected index 3adebae5dac..b4eda743030 100644 --- a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/selections/GetPageSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/selections/GetPageSelections.kt.expected @@ -8,10 +8,10 @@ package com.example.test_inline.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.test_inline.type.Collection +import com.example.test_inline.type.GraphQLString import com.example.test_inline.type.Item import kotlin.collections.List @@ -19,21 +19,21 @@ public object GetPageSelections { private val items: List = listOf( CompiledField.Builder( name = "title", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onParticularItem: List = listOf( CompiledField.Builder( name = "image", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val items1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "ParticularItem", @@ -53,7 +53,7 @@ public object GetPageSelections { private val collection: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "items", diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b224cc410f5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..37a2f854941 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..95edbed966e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..54d6adda20d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..2817333b5cd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/operationBased/test_inline/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/selections/GetPageSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/selections/GetPageSelections.kt.expected index 3adebae5dac..b4eda743030 100644 --- a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/selections/GetPageSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/selections/GetPageSelections.kt.expected @@ -8,10 +8,10 @@ package com.example.test_inline.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.test_inline.type.Collection +import com.example.test_inline.type.GraphQLString import com.example.test_inline.type.Item import kotlin.collections.List @@ -19,21 +19,21 @@ public object GetPageSelections { private val items: List = listOf( CompiledField.Builder( name = "title", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onParticularItem: List = listOf( CompiledField.Builder( name = "image", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val items1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "ParticularItem", @@ -53,7 +53,7 @@ public object GetPageSelections { private val collection: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "items", diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b224cc410f5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..37a2f854941 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..95edbed966e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..54d6adda20d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..2817333b5cd --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/test_inline/kotlin/responseBased/test_inline/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.test_inline.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/selections/TestQuerySelections.java.expected index e4356d69767..8a77ca65a71 100644 --- a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/selections/TestQuerySelections.java.expected @@ -7,21 +7,22 @@ package com.example.two_heroes_unique.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.two_heroes_unique.type.Character; +import com.example.two_heroes_unique.type.GraphQLID; +import com.example.two_heroes_unique.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List r2 = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List luke = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..41f6e27535e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..d89e370c054 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLID.java.expected new file mode 100644 index 00000000000..1a6ae5ce19e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..4ec28ee76bb --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLString.java.expected new file mode 100644 index 00000000000..da9da11d1b8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/java/operationBased/two_heroes_unique/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/selections/TestQuerySelections.kt.expected index c42a0b73a4c..b9d04d0a787 100644 --- a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/selections/TestQuerySelections.kt.expected @@ -7,29 +7,29 @@ package com.example.two_heroes_unique.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.two_heroes_unique.type.Character +import com.example.two_heroes_unique.type.GraphQLID +import com.example.two_heroes_unique.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val r2: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val luke: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..5874ada9dc4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..c2277c34b34 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..c969e22f198 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..fe43f252ed4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..01fde0a72f8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_unique/kotlin/responseBased/two_heroes_unique/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_unique.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/selections/TestQuerySelections.java.expected index adfb0ecb92d..efde1d95a75 100644 --- a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/selections/TestQuerySelections.java.expected @@ -7,19 +7,21 @@ package com.example.two_heroes_with_friends.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.two_heroes_with_friends.type.Character; import com.example.two_heroes_with_friends.type.FriendsConnection; import com.example.two_heroes_with_friends.type.FriendsEdge; +import com.example.two_heroes_with_friends.type.GraphQLID; +import com.example.two_heroes_with_friends.type.GraphQLInt; +import com.example.two_heroes_with_friends.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -27,17 +29,17 @@ public class TestQuerySelections { ); private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges).build() ); private static List r2 = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); private static List node1 = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges1 = Arrays.asList( @@ -45,13 +47,13 @@ public class TestQuerySelections { ); private static List friendsConnection1 = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges1).build() ); private static List luke = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection1).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..b74a9d0106f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..149ba8e8409 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLID.java.expected new file mode 100644 index 00000000000..e1f7daecd89 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..97390654db3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLString.java.expected new file mode 100644 index 00000000000..cf65ea13961 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/java/operationBased/two_heroes_with_friends/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/selections/TestQuerySelections.kt.expected index 41235d65938..9ab6c04e310 100644 --- a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/selections/TestQuerySelections.kt.expected @@ -7,22 +7,22 @@ package com.example.two_heroes_with_friends.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIDType -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.two_heroes_with_friends.type.Character import com.example.two_heroes_with_friends.type.FriendsConnection import com.example.two_heroes_with_friends.type.FriendsEdge +import com.example.two_heroes_with_friends.type.GraphQLID +import com.example.two_heroes_with_friends.type.GraphQLInt +import com.example.two_heroes_with_friends.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -37,7 +37,7 @@ public object TestQuerySelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -49,7 +49,7 @@ public object TestQuerySelections { private val r2: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", @@ -61,7 +61,7 @@ public object TestQuerySelections { private val node1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -76,7 +76,7 @@ public object TestQuerySelections { private val friendsConnection1: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -88,11 +88,11 @@ public object TestQuerySelections { private val luke: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..a22d59f1485 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..87287b961fc --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..b03f830fc0e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..950433d70c6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..2bdecfce06a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/two_heroes_with_friends/kotlin/responseBased/two_heroes_with_friends/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.two_heroes_with_friends.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/selections/TestQuerySelections.java.expected index 72ac5fa1986..1e218f9b80b 100644 --- a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/selections/TestQuerySelections.java.expected @@ -7,33 +7,34 @@ package com.example.typename_always_first.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.typename_always_first.type.Character; +import com.example.typename_always_first.type.GraphQLFloat; +import com.example.typename_always_first.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build(), - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("height", GraphQLFloat.type).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build() ); private static List hero = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); public static List root = Arrays.asList( new CompiledField.Builder("hero", Character.type).selections(hero).build(), - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..6f97f9df62d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..7501de46d19 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLID.java.expected new file mode 100644 index 00000000000..cde48c44785 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..1b3847a3112 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLString.java.expected new file mode 100644 index 00000000000..4f1d5c0ed3a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/java/operationBased/typename_always_first/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/selections/TestQuerySelections.kt.expected index 49273802f1a..5a6af8380fd 100644 --- a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/selections/TestQuerySelections.kt.expected @@ -6,45 +6,45 @@ package com.example.typename_always_first.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.typename_always_first.type.Character +import com.example.typename_always_first.type.GraphQLFloat +import com.example.typename_always_first.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -66,7 +66,7 @@ public object TestQuerySelections { .build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..45bad28cdd6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d5b0c311ccf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3c0161ae889 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..aa556031e0a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..ad08ed56104 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/compat/typename_always_first/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/selections/TestQuerySelections.kt.expected index 49273802f1a..5a6af8380fd 100644 --- a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/selections/TestQuerySelections.kt.expected @@ -6,45 +6,45 @@ package com.example.typename_always_first.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.typename_always_first.type.Character +import com.example.typename_always_first.type.GraphQLFloat +import com.example.typename_always_first.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -66,7 +66,7 @@ public object TestQuerySelections { .build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..45bad28cdd6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d5b0c311ccf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3c0161ae889 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..aa556031e0a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..ad08ed56104 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/operationBased/typename_always_first/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/selections/TestQuerySelections.kt.expected index 49273802f1a..5a6af8380fd 100644 --- a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/selections/TestQuerySelections.kt.expected @@ -6,45 +6,45 @@ package com.example.typename_always_first.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull import com.example.typename_always_first.type.Character +import com.example.typename_always_first.type.GraphQLFloat +import com.example.typename_always_first.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build() ) private val hero: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Human", @@ -66,7 +66,7 @@ public object TestQuerySelections { .build(), CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..45bad28cdd6 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..d5b0c311ccf --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..3c0161ae889 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..aa556031e0a --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..ad08ed56104 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/typename_always_first/kotlin/responseBased/typename_always_first/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.typename_always_first.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/fragment/selections/StarshipSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/fragment/selections/StarshipSelections.java.expected index 74c0b915ad8..fe55a4c4255 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/fragment/selections/StarshipSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/fragment/selections/StarshipSelections.java.expected @@ -6,14 +6,14 @@ package com.example.union_fragment.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; +import com.example.union_fragment.type.GraphQLString; import java.util.Arrays; import java.util.List; public class StarshipSelections { public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/selections/TestQuerySelections.java.expected index 4709a373672..6f36c153aac 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/selections/TestQuerySelections.java.expected @@ -8,22 +8,23 @@ package com.example.union_fragment.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.union_fragment.fragment.selections.StarshipSelections; +import com.example.union_fragment.type.GraphQLID; +import com.example.union_fragment.type.GraphQLString; import com.example.union_fragment.type.SearchResult; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onStarship = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build() ); private static List search = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Starship", Arrays.asList("Starship")).selections(onStarship).build(), new CompiledFragment.Builder("Starship", Arrays.asList("Starship")).selections(StarshipSelections.root).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..715f507e8f8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..1ae72365283 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLID.java.expected new file mode 100644 index 00000000000..b94db960a3f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..8011066ff9d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLString.java.expected new file mode 100644 index 00000000000..1b89cabde0e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/java/operationBased/union_fragment/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/fragment/selections/StarshipSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/fragment/selections/StarshipSelections.kt.expected index 3951ad41656..5e3f9ce27e8 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/fragment/selections/StarshipSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/fragment/selections/StarshipSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.union_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.union_fragment.type.GraphQLString import kotlin.collections.List public object StarshipSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/selections/TestQuerySelections.kt.expected index d73925b4c99..803fdb1ccf0 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.union_fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.union_fragment.fragment.selections.StarshipSelections +import com.example.union_fragment.type.GraphQLID +import com.example.union_fragment.type.GraphQLString import com.example.union_fragment.type.SearchResult import kotlin.collections.List @@ -21,14 +21,14 @@ public object TestQuerySelections { private val onStarship: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Starship", diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f0657b4f157 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..64b0051fbc9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..51e3e124600 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2bfb9aa1bf2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..76a8c120e08 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/compat/union_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/fragment/selections/StarshipSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/fragment/selections/StarshipSelections.kt.expected index 3951ad41656..5e3f9ce27e8 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/fragment/selections/StarshipSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/fragment/selections/StarshipSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.union_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.union_fragment.type.GraphQLString import kotlin.collections.List public object StarshipSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/selections/TestQuerySelections.kt.expected index d73925b4c99..803fdb1ccf0 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.union_fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.union_fragment.fragment.selections.StarshipSelections +import com.example.union_fragment.type.GraphQLID +import com.example.union_fragment.type.GraphQLString import com.example.union_fragment.type.SearchResult import kotlin.collections.List @@ -21,14 +21,14 @@ public object TestQuerySelections { private val onStarship: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Starship", diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f0657b4f157 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..64b0051fbc9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..51e3e124600 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2bfb9aa1bf2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..76a8c120e08 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/operationBased/union_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/fragment/selections/StarshipSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/fragment/selections/StarshipSelections.kt.expected index 3951ad41656..5e3f9ce27e8 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/fragment/selections/StarshipSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/fragment/selections/StarshipSelections.kt.expected @@ -7,15 +7,15 @@ package com.example.union_fragment.fragment.selections import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.notNull +import com.example.union_fragment.type.GraphQLString import kotlin.collections.List public object StarshipSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) } diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/selections/TestQuerySelections.kt.expected index d73925b4c99..803fdb1ccf0 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/selections/TestQuerySelections.kt.expected @@ -8,12 +8,12 @@ package com.example.union_fragment.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.union_fragment.fragment.selections.StarshipSelections +import com.example.union_fragment.type.GraphQLID +import com.example.union_fragment.type.GraphQLString import com.example.union_fragment.type.SearchResult import kotlin.collections.List @@ -21,14 +21,14 @@ public object TestQuerySelections { private val onStarship: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Starship", diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..f0657b4f157 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..64b0051fbc9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..51e3e124600 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..2bfb9aa1bf2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..76a8c120e08 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_fragment/kotlin/responseBased/union_fragment/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_fragment.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/selections/TestQuerySelections.java.expected index 3417bdb1354..c667e7f3f8f 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/selections/TestQuerySelections.java.expected @@ -8,19 +8,20 @@ package com.example.union_inline_fragments.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.union_inline_fragments.type.Character; import com.example.union_inline_fragments.type.Episode; +import com.example.union_inline_fragments.type.GraphQLID; +import com.example.union_inline_fragments.type.GraphQLString; import com.example.union_inline_fragments.type.SearchResult; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List onCharacter1 = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List onCharacter2 = Arrays.asList( @@ -28,43 +29,43 @@ public class TestQuerySelections { ); private static List friends1 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter2).build() ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("homePlanet", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("homePlanet", GraphQLString.type).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends1).build() ); private static List friends2 = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build() + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build() ); private static List onDroid = Arrays.asList( - new CompiledField.Builder("primaryFunction", CompiledGraphQL.CompiledStringType).build(), + new CompiledField.Builder("primaryFunction", GraphQLString.type).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends2).build() ); private static List friends = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter1).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build(), new CompiledFragment.Builder("Droid", Arrays.asList("Droid")).selections(onDroid).build() ); private static List onCharacter = Arrays.asList( - new CompiledField.Builder("id", new CompiledNotNullType(CompiledGraphQL.CompiledIDType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("id", new CompiledNotNullType(GraphQLID.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends).build() ); private static List onStarship = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List search = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(onCharacter).build(), new CompiledFragment.Builder("Starship", Arrays.asList("Starship")).selections(onStarship).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..e0362b86b16 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..6f1e910b34e --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLID.java.expected new file mode 100644 index 00000000000..e391b1e5581 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..8ef515df6e2 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLString.java.expected new file mode 100644 index 00000000000..e1557684714 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/java/operationBased/union_inline_fragments/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/selections/TestQuerySelections.kt.expected index 0407c2ea500..d877e21b6c2 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/selections/TestQuerySelections.kt.expected @@ -8,13 +8,13 @@ package com.example.union_inline_fragments.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.union_inline_fragments.type.Character import com.example.union_inline_fragments.type.Episode +import com.example.union_inline_fragments.type.GraphQLID +import com.example.union_inline_fragments.type.GraphQLString import com.example.union_inline_fragments.type.SearchResult import kotlin.collections.List @@ -22,7 +22,7 @@ public object TestQuerySelections { private val onCharacter1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -36,7 +36,7 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -48,7 +48,7 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -60,14 +60,14 @@ public object TestQuerySelections { private val friends2: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -79,7 +79,7 @@ public object TestQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -101,11 +101,11 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", @@ -117,14 +117,14 @@ public object TestQuerySelections { private val onStarship: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..61b99c326c1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fdef7ac76ce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..268121f4fd7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1c9d0537119 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0b91d2d3e4d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/compat/union_inline_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/selections/TestQuerySelections.kt.expected index 0407c2ea500..d877e21b6c2 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/selections/TestQuerySelections.kt.expected @@ -8,13 +8,13 @@ package com.example.union_inline_fragments.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.union_inline_fragments.type.Character import com.example.union_inline_fragments.type.Episode +import com.example.union_inline_fragments.type.GraphQLID +import com.example.union_inline_fragments.type.GraphQLString import com.example.union_inline_fragments.type.SearchResult import kotlin.collections.List @@ -22,7 +22,7 @@ public object TestQuerySelections { private val onCharacter1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -36,7 +36,7 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -48,7 +48,7 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -60,14 +60,14 @@ public object TestQuerySelections { private val friends2: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -79,7 +79,7 @@ public object TestQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -101,11 +101,11 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", @@ -117,14 +117,14 @@ public object TestQuerySelections { private val onStarship: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..61b99c326c1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fdef7ac76ce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..268121f4fd7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1c9d0537119 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0b91d2d3e4d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/operationBased/union_inline_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/selections/TestQuerySelections.kt.expected index 0407c2ea500..d877e21b6c2 100644 --- a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/selections/TestQuerySelections.kt.expected @@ -8,13 +8,13 @@ package com.example.union_inline_fragments.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledFragment -import com.apollographql.apollo3.api.CompiledIDType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.union_inline_fragments.type.Character import com.example.union_inline_fragments.type.Episode +import com.example.union_inline_fragments.type.GraphQLID +import com.example.union_inline_fragments.type.GraphQLString import com.example.union_inline_fragments.type.SearchResult import kotlin.collections.List @@ -22,7 +22,7 @@ public object TestQuerySelections { private val onCharacter1: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -36,7 +36,7 @@ public object TestQuerySelections { private val friends1: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -48,7 +48,7 @@ public object TestQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "homePlanet", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -60,14 +60,14 @@ public object TestQuerySelections { private val friends2: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build() ) private val onDroid: List = listOf( CompiledField.Builder( name = "primaryFunction", - type = CompiledStringType + type = GraphQLString.type ).build(), CompiledField.Builder( name = "friends", @@ -79,7 +79,7 @@ public object TestQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -101,11 +101,11 @@ public object TestQuerySelections { private val onCharacter: List = listOf( CompiledField.Builder( name = "id", - type = CompiledIDType.notNull() + type = GraphQLID.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", @@ -117,14 +117,14 @@ public object TestQuerySelections { private val onStarship: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val search: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..61b99c326c1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..fdef7ac76ce --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..268121f4fd7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..1c9d0537119 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..0b91d2d3e4d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/union_inline_fragments/kotlin/responseBased/union_inline_fragments/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.union_inline_fragments.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.java.expected index d8882c6fecf..0de4d45244a 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.java.expected @@ -6,19 +6,20 @@ package com.example.unique_type_name.fragment.selections; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.unique_type_name.type.Character; import com.example.unique_type_name.type.FriendsConnection; import com.example.unique_type_name.type.FriendsEdge; +import com.example.unique_type_name.type.GraphQLInt; +import com.example.unique_type_name.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailsSelections { private static List node = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List edges = Arrays.asList( @@ -26,12 +27,12 @@ public class HeroDetailsSelections { ); private static List friendsConnection = Arrays.asList( - new CompiledField.Builder("totalCount", CompiledGraphQL.CompiledIntType).build(), + new CompiledField.Builder("totalCount", GraphQLInt.type).build(), new CompiledField.Builder("edges", new CompiledListType(FriendsEdge.type)).selections(edges).build() ); public static List root = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friendsConnection", new CompiledNotNullType(FriendsConnection.type)).selections(friendsConnection).build() ); } diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/selections/HeroDetailQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/selections/HeroDetailQuerySelections.java.expected index 96790e8d4a9..ed9f17cb087 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/selections/HeroDetailQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/selections/HeroDetailQuerySelections.java.expected @@ -7,23 +7,24 @@ package com.example.unique_type_name.selections; import com.apollographql.apollo3.api.CompiledField; import com.apollographql.apollo3.api.CompiledFragment; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledListType; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.example.unique_type_name.fragment.selections.HeroDetailsSelections; import com.example.unique_type_name.type.Character; import com.example.unique_type_name.type.Episode; +import com.example.unique_type_name.type.GraphQLFloat; +import com.example.unique_type_name.type.GraphQLString; import java.util.Arrays; import java.util.List; public class HeroDetailQuerySelections { private static List friends = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); private static List friends2 = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledFragment.Builder("Character", Arrays.asList("Droid", "Human")).selections(HeroDetailsSelections.root).build() ); @@ -33,13 +34,13 @@ public class HeroDetailQuerySelections { ); private static List onHuman = Arrays.asList( - new CompiledField.Builder("height", CompiledGraphQL.CompiledFloatType).build(), + new CompiledField.Builder("height", GraphQLFloat.type).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends1).build() ); private static List heroDetailQuery = Arrays.asList( - new CompiledField.Builder("__typename", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build(), + new CompiledField.Builder("__typename", new CompiledNotNullType(GraphQLString.type)).build(), + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build(), new CompiledField.Builder("friends", new CompiledListType(Character.type)).selections(friends).build(), new CompiledFragment.Builder("Human", Arrays.asList("Human")).selections(onHuman).build() ); diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..25fd62e8331 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..a7a355f08b1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLID.java.expected new file mode 100644 index 00000000000..90baff4a1d5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..b0cde9993d3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLString.java.expected new file mode 100644 index 00000000000..f34fbb1af77 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/java/operationBased/unique_type_name/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected index e63db0d6904..6a3f8310bc1 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.unique_type_name.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.unique_type_name.type.Character import com.example.unique_type_name.type.FriendsConnection import com.example.unique_type_name.type.FriendsEdge +import com.example.unique_type_name.type.GraphQLInt +import com.example.unique_type_name.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/selections/HeroDetailQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/selections/HeroDetailQuerySelections.kt.expected index dd8159bffcc..c6ea902b94e 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/selections/HeroDetailQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/selections/HeroDetailQuerySelections.kt.expected @@ -6,29 +6,29 @@ package com.example.unique_type_name.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.unique_type_name.fragment.selections.HeroDetailsSelections import com.example.unique_type_name.type.Character import com.example.unique_type_name.type.Episode +import com.example.unique_type_name.type.GraphQLFloat +import com.example.unique_type_name.type.GraphQLString import kotlin.collections.List public object HeroDetailQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val friends2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -52,7 +52,7 @@ public object HeroDetailQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "friends", @@ -64,11 +64,11 @@ public object HeroDetailQuerySelections { private val heroDetailQuery: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..38aee524b29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..6c92ff9d010 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..e88b7becae1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..be2babd98a7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..058b6b4344f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/compat/unique_type_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected index e63db0d6904..6a3f8310bc1 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.unique_type_name.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.unique_type_name.type.Character import com.example.unique_type_name.type.FriendsConnection import com.example.unique_type_name.type.FriendsEdge +import com.example.unique_type_name.type.GraphQLInt +import com.example.unique_type_name.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected index dd8159bffcc..c6ea902b94e 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected @@ -6,29 +6,29 @@ package com.example.unique_type_name.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.unique_type_name.fragment.selections.HeroDetailsSelections import com.example.unique_type_name.type.Character import com.example.unique_type_name.type.Episode +import com.example.unique_type_name.type.GraphQLFloat +import com.example.unique_type_name.type.GraphQLString import kotlin.collections.List public object HeroDetailQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val friends2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -52,7 +52,7 @@ public object HeroDetailQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "friends", @@ -64,11 +64,11 @@ public object HeroDetailQuerySelections { private val heroDetailQuery: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..38aee524b29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..6c92ff9d010 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..e88b7becae1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..be2babd98a7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..058b6b4344f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/operationBased/unique_type_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected index e63db0d6904..6a3f8310bc1 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/fragment/selections/HeroDetailsSelections.kt.expected @@ -6,21 +6,21 @@ package com.example.unique_type_name.fragment.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledIntType import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.unique_type_name.type.Character import com.example.unique_type_name.type.FriendsConnection import com.example.unique_type_name.type.FriendsEdge +import com.example.unique_type_name.type.GraphQLInt +import com.example.unique_type_name.type.GraphQLString import kotlin.collections.List public object HeroDetailsSelections { private val node: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) @@ -35,7 +35,7 @@ public object HeroDetailsSelections { private val friendsConnection: List = listOf( CompiledField.Builder( name = "totalCount", - type = CompiledIntType + type = GraphQLInt.type ).build(), CompiledField.Builder( name = "edges", @@ -47,7 +47,7 @@ public object HeroDetailsSelections { public val root: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friendsConnection", diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected index dd8159bffcc..c6ea902b94e 100644 --- a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/selections/HeroDetailQuerySelections.kt.expected @@ -6,29 +6,29 @@ package com.example.unique_type_name.selections import com.apollographql.apollo3.api.CompiledField -import com.apollographql.apollo3.api.CompiledFloatType import com.apollographql.apollo3.api.CompiledFragment import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.list import com.apollographql.apollo3.api.notNull import com.example.unique_type_name.fragment.selections.HeroDetailsSelections import com.example.unique_type_name.type.Character import com.example.unique_type_name.type.Episode +import com.example.unique_type_name.type.GraphQLFloat +import com.example.unique_type_name.type.GraphQLString import kotlin.collections.List public object HeroDetailQuerySelections { private val friends: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) private val friends2: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledFragment.Builder( typeCondition = "Character", @@ -52,7 +52,7 @@ public object HeroDetailQuerySelections { private val onHuman: List = listOf( CompiledField.Builder( name = "height", - type = CompiledFloatType + type = GraphQLFloat.type ).build(), CompiledField.Builder( name = "friends", @@ -64,11 +64,11 @@ public object HeroDetailQuerySelections { private val heroDetailQuery: List = listOf( CompiledField.Builder( name = "__typename", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build(), CompiledField.Builder( name = "friends", diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..38aee524b29 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..6c92ff9d010 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..e88b7becae1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..be2babd98a7 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..058b6b4344f --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/unique_type_name/kotlin/responseBased/unique_type_name/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.unique_type_name.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/selections/TestQuerySelections.java.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/selections/TestQuerySelections.java.expected index b222f877efb..2533dde5c88 100644 --- a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/selections/TestQuerySelections.java.expected +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/selections/TestQuerySelections.java.expected @@ -7,17 +7,17 @@ package com.example.variable_default_value.selections; import com.apollographql.apollo3.api.CompiledArgument; import com.apollographql.apollo3.api.CompiledField; -import com.apollographql.apollo3.api.CompiledGraphQL; import com.apollographql.apollo3.api.CompiledNotNullType; import com.apollographql.apollo3.api.CompiledSelection; import com.apollographql.apollo3.api.CompiledVariable; import com.example.variable_default_value.type.Character; +import com.example.variable_default_value.type.GraphQLString; import java.util.Arrays; import java.util.List; public class TestQuerySelections { private static List hero = Arrays.asList( - new CompiledField.Builder("name", new CompiledNotNullType(CompiledGraphQL.CompiledStringType)).build() + new CompiledField.Builder("name", new CompiledNotNullType(GraphQLString.type)).build() ); public static List root = Arrays.asList( diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLBoolean.java.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLBoolean.java.expected new file mode 100644 index 00000000000..357381452b4 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLBoolean.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public static CustomScalarType type = new CustomScalarType("Boolean", "java.lang.Boolean"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLFloat.java.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLFloat.java.expected new file mode 100644 index 00000000000..c2423a13dc3 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLFloat.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public static CustomScalarType type = new CustomScalarType("Float", "java.lang.Float"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLID.java.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLID.java.expected new file mode 100644 index 00000000000..c2fac264467 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLID.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + */ +public class GraphQLID { + public static CustomScalarType type = new CustomScalarType("ID", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLInt.java.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLInt.java.expected new file mode 100644 index 00000000000..201301ffea9 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLInt.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public static CustomScalarType type = new CustomScalarType("Int", "java.lang.Integer"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLString.java.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLString.java.expected new file mode 100644 index 00000000000..36709be4430 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/java/operationBased/variable_default_value/type/GraphQLString.java.expected @@ -0,0 +1,15 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type; + +import com.apollographql.apollo3.api.CustomScalarType; + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public static CustomScalarType type = new CustomScalarType("String", "java.lang.String"); +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/selections/TestQuerySelections.kt.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/selections/TestQuerySelections.kt.expected index fbb69c9f176..e33e39f5024 100644 --- a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/selections/TestQuerySelections.kt.expected +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/selections/TestQuerySelections.kt.expected @@ -8,17 +8,17 @@ package com.example.variable_default_value.selections import com.apollographql.apollo3.api.CompiledArgument import com.apollographql.apollo3.api.CompiledField import com.apollographql.apollo3.api.CompiledSelection -import com.apollographql.apollo3.api.CompiledStringType import com.apollographql.apollo3.api.CompiledVariable import com.apollographql.apollo3.api.notNull import com.example.variable_default_value.type.Character +import com.example.variable_default_value.type.GraphQLString import kotlin.collections.List public object TestQuerySelections { private val hero: List = listOf( CompiledField.Builder( name = "name", - type = CompiledStringType.notNull() + type = GraphQLString.type.notNull() ).build() ) diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLBoolean.kt.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLBoolean.kt.expected new file mode 100644 index 00000000000..b92fad7c8a5 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLBoolean.kt.expected @@ -0,0 +1,17 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Boolean` scalar type represents `true` or `false`. + */ +public class GraphQLBoolean { + public companion object { + public val type: CustomScalarType = CustomScalarType("Boolean", "kotlin.Boolean") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLFloat.kt.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLFloat.kt.expected new file mode 100644 index 00000000000..bbbb4e6acf8 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLFloat.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Float` scalar type represents signed double-precision fractional values as specified by + * [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). + */ +public class GraphQLFloat { + public companion object { + public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLID.kt.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLID.kt.expected new file mode 100644 index 00000000000..76687af9241 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLID.kt.expected @@ -0,0 +1,20 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `ID` scalar type represents a unique identifier, often used to refetch an object or as key + * for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be + * human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) + * input value will be accepted as an ID. + */ +public class GraphQLID { + public companion object { + public val type: CustomScalarType = CustomScalarType("ID", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLInt.kt.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLInt.kt.expected new file mode 100644 index 00000000000..a61ce69a6b1 --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLInt.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent + * values between -(2^31) and 2^31 - 1. + */ +public class GraphQLInt { + public companion object { + public val type: CustomScalarType = CustomScalarType("Int", "kotlin.Int") + } +} diff --git a/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLString.kt.expected b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLString.kt.expected new file mode 100644 index 00000000000..8f8192cb57d --- /dev/null +++ b/apollo-compiler/src/test/graphql/com/example/variable_default_value/kotlin/responseBased/variable_default_value/type/GraphQLString.kt.expected @@ -0,0 +1,18 @@ +// +// AUTO-GENERATED FILE. DO NOT MODIFY. +// +// This class was automatically generated by Apollo GraphQL version '$VERSION'. +// +package com.example.variable_default_value.type + +import com.apollographql.apollo3.api.CustomScalarType + +/** + * The `String` scalar type represents textual data, represented as UTF-8 character sequences. The + * String type is most often used by GraphQL to represent free-form human-readable text. + */ +public class GraphQLString { + public companion object { + public val type: CustomScalarType = CustomScalarType("String", "kotlin.String") + } +} diff --git a/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/CodegenTest.kt b/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/CodegenTest.kt index 8396cecb6d7..34519390c0c 100644 --- a/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/CodegenTest.kt +++ b/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/CodegenTest.kt @@ -269,17 +269,6 @@ class CodegenTest { } private fun options(folder: File, codegenModels: String, generateKotlinModels: Boolean): Options { - val customScalarsMapping = if (folder.name in listOf( - "custom_scalar_type", - "input_object_type", - "mutation_create_review")) { - mapOf( - "Date" to "java.util.Date", - "URL" to "java.lang.String", - ) - } else { - emptyMap() - } val useSemanticNaming = when (folder.name) { "hero_details_semantic_naming" -> true "mutation_create_review_semantic_naming" -> true @@ -327,6 +316,19 @@ class CodegenTest { codegenModels == MODELS_COMPAT } } + val customScalarsMapping = if (folder.name in listOf( + "custom_scalar_type", + "input_object_type", + "mutation_create_review")) { + mapOf( + "Date" to ScalarInfo("java.util.Date"), + "URL" to ScalarInfo("java.lang.String", ExpressionAdapterInitializer(if (targetLanguage == JAVA) "com.example.UrlAdapter.INSTANCE" else "com.example.UrlAdapter")), + "ID" to ScalarInfo("java.lang.Long"), + "String" to ScalarInfo("java.lang.String", ExpressionAdapterInitializer(if (targetLanguage == JAVA) "new com.example.MyStringAdapter()" else "com.example.MyStringAdapter()")), + ) + } else { + emptyMap() + } return Options( executableFiles = graphqlFiles, @@ -335,7 +337,7 @@ class CodegenTest { packageName = "com.example.${folder.name}" ).copy( operationOutputGenerator = operationOutputGenerator, - customScalarsMapping = customScalarsMapping, + scalarMapping = customScalarsMapping, codegenModels = codegenModels, flattenModels = flattenModels, useSemanticNaming = useSemanticNaming, diff --git a/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/MetadataTest.kt b/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/MetadataTest.kt index 3b41fc6fcaa..a9942fb9670 100644 --- a/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/MetadataTest.kt +++ b/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/MetadataTest.kt @@ -3,8 +3,7 @@ package com.apollographql.apollo3.compiler import com.apollographql.apollo3.annotations.ApolloExperimental import com.apollographql.apollo3.ast.Schema import com.apollographql.apollo3.ast.SourceAwareException -import com.apollographql.apollo3.ast.toSchema -import com.apollographql.apollo3.compiler.Options.Companion.defaultCustomScalarsMapping +import com.apollographql.apollo3.compiler.Options.Companion.defaultScalarMapping import com.apollographql.apollo3.compiler.introspection.toSchema import com.google.common.truth.Truth import org.junit.Assert.fail @@ -48,7 +47,8 @@ class MetadataTest { schema = schema, codegenModels = codegenModels, schemaPackageName = "", - pluginVersion = APOLLO_VERSION + pluginVersion = APOLLO_VERSION, + scalarMapping = emptyMap() ) } else { val metadata = metadataFiles.map { ApolloMetadata.readFrom(it) } @@ -67,8 +67,8 @@ class MetadataTest { schemaPackageName = "", packageNameGenerator = PackageNameGenerator.Flat(""), alwaysGenerateTypesMatching = alwaysGenerateTypesMatching, - incomingCompilerMetadata =incomingCompilerMetadata, - customScalarsMapping = defaultCustomScalarsMapping, + incomingCompilerMetadata = incomingCompilerMetadata, + scalarMapping = defaultScalarMapping, codegenModels = codegenModels, flattenModels = true, moduleName = "test", @@ -115,7 +115,13 @@ class MetadataTest { alwaysGenerateTypesMatchingTest(emptySet()) // Only scalar types are generated in the root - rootSourcesDir.assertContents() + rootSourcesDir.assertContents( + "GraphQLBoolean.kt", + "GraphQLFloat.kt", + "GraphQLID.kt", + "GraphQLInt.kt", + "GraphQLString.kt" + ) // Leaf contains its referenced types but not the unused ones leafSourcesDir.assertContents( @@ -145,11 +151,16 @@ class MetadataTest { rootSourcesDir.assertContents( "Body1.kt", "Body1_InputAdapter.kt", + "GraphQLBoolean.kt", "CustomScalar1.kt", "Encoding.kt", "Encoding_ResponseAdapter.kt", + "GraphQLFloat.kt", + "GraphQLID.kt", + "GraphQLInt.kt", "MessageInput1.kt", "MessageInput1_InputAdapter.kt", + "GraphQLString.kt", "User1.kt", "User1_InputAdapter.kt" ) @@ -199,11 +210,16 @@ class MetadataTest { // Root generates the fragment rootSourcesDir.assertContents( + "GraphQLBoolean.kt", "Character.kt", "CharacterFragment.kt", "CharacterFragmentSelections.kt", "Episode.kt", "Episode_ResponseAdapter.kt", + "GraphQLFloat.kt", + "GraphQLID.kt", + "GraphQLInt.kt", + "GraphQLString.kt" ) // Leaf contains the query but not the fragment @@ -246,9 +262,14 @@ class MetadataTest { fragmentTest("fragment-multiple") rootSourcesDir.assertContents( + "GraphQLBoolean.kt", "Character.kt", "CharacterFragment.kt", "CharacterFragmentSelections.kt", + "GraphQLFloat.kt", + "GraphQLID.kt", + "GraphQLInt.kt", + "GraphQLString.kt" ) leafSourcesDir.assertContents( diff --git a/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/conditionalFragments/ConditionalFragmentsTest.kt b/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/conditionalFragments/ConditionalFragmentsTest.kt index 6df315244eb..8c73d352da7 100644 --- a/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/conditionalFragments/ConditionalFragmentsTest.kt +++ b/apollo-compiler/src/test/kotlin/com/apollographql/apollo3/compiler/conditionalFragments/ConditionalFragmentsTest.kt @@ -22,7 +22,7 @@ class ConditionalFragmentsTest { outputDir = File("build/test/conditionalFragmentsTest"), packageName = "" ).copy( - customScalarsMapping = emptyMap(), + scalarMapping = emptyMap(), codegenModels = MODELS_RESPONSE_BASED, flattenModels = false ) @@ -41,10 +41,10 @@ class ConditionalFragmentsTest { outputDir = File("build/test/conditionalFragmentsTest"), packageName = "" ).copy( - customScalarsMapping = emptyMap(), + scalarMapping = emptyMap(), codegenModels = MODELS_OPERATION_BASED, flattenModels = false ) ) } -} \ No newline at end of file +} diff --git a/apollo-compiler/src/test/kotlin/com/example/MyStringAdapter.kt b/apollo-compiler/src/test/kotlin/com/example/MyStringAdapter.kt new file mode 100644 index 00000000000..b5a4999c154 --- /dev/null +++ b/apollo-compiler/src/test/kotlin/com/example/MyStringAdapter.kt @@ -0,0 +1,17 @@ +package com.example + +import com.apollographql.apollo3.api.Adapter +import com.apollographql.apollo3.api.CustomScalarAdapters +import com.apollographql.apollo3.api.json.JsonReader +import com.apollographql.apollo3.api.json.JsonWriter + +@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") +class MyStringAdapter : Adapter { + override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): java.lang.String { + return reader.nextString()!! as java.lang.String + } + + override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: java.lang.String) { + writer.value(value as String) + } +} diff --git a/apollo-compiler/src/test/kotlin/com/example/UrlAdapter.kt b/apollo-compiler/src/test/kotlin/com/example/UrlAdapter.kt new file mode 100644 index 00000000000..10b28eb8351 --- /dev/null +++ b/apollo-compiler/src/test/kotlin/com/example/UrlAdapter.kt @@ -0,0 +1,17 @@ +package com.example + +import com.apollographql.apollo3.api.Adapter +import com.apollographql.apollo3.api.CustomScalarAdapters +import com.apollographql.apollo3.api.json.JsonReader +import com.apollographql.apollo3.api.json.JsonWriter + +@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") +object UrlAdapter : Adapter { + override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): java.lang.String { + return reader.nextString()!! as java.lang.String + } + + override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: java.lang.String) { + writer.value(value as String) + } +} diff --git a/apollo-gradle-plugin/api/apollo-gradle-plugin.api b/apollo-gradle-plugin/api/apollo-gradle-plugin.api index f5420d0f391..3412ebb3bdb 100644 --- a/apollo-gradle-plugin/api/apollo-gradle-plugin.api +++ b/apollo-gradle-plugin/api/apollo-gradle-plugin.api @@ -77,6 +77,7 @@ public abstract interface class com/apollographql/apollo3/gradle/api/Service { public abstract fun getGenerateQueryDocument ()Lorg/gradle/api/provider/Property; public abstract fun getGenerateSchema ()Lorg/gradle/api/provider/Property; public abstract fun getGenerateTestBuilders ()Lorg/gradle/api/provider/Property; + public abstract fun getGeneratedSchemaName ()Lorg/gradle/api/provider/Property; public abstract fun getIncludes ()Lorg/gradle/api/provider/ListProperty; public abstract fun getLanguageVersion ()Lorg/gradle/api/provider/Property; public abstract fun getName ()Ljava/lang/String; @@ -95,6 +96,23 @@ public abstract interface class com/apollographql/apollo3/gradle/api/Service { public abstract fun getUseSemanticNaming ()Lorg/gradle/api/provider/Property; public abstract fun getWarnOnDeprecatedUsages ()Lorg/gradle/api/provider/Property; public abstract fun introspection (Lorg/gradle/api/Action;)V + public abstract fun mapScalar (Ljava/lang/String;Ljava/lang/String;)V + public abstract fun mapScalar (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public abstract fun mapScalarToJavaBoolean (Ljava/lang/String;)V + public abstract fun mapScalarToJavaDouble (Ljava/lang/String;)V + public abstract fun mapScalarToJavaFloat (Ljava/lang/String;)V + public abstract fun mapScalarToJavaInteger (Ljava/lang/String;)V + public abstract fun mapScalarToJavaLong (Ljava/lang/String;)V + public abstract fun mapScalarToJavaObject (Ljava/lang/String;)V + public abstract fun mapScalarToJavaString (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinAny (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinBoolean (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinDouble (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinFloat (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinInt (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinLong (Ljava/lang/String;)V + public abstract fun mapScalarToKotlinString (Ljava/lang/String;)V + public abstract fun mapScalarToUpload (Ljava/lang/String;)V public abstract fun operationOutputConnection (Lorg/gradle/api/Action;)V public abstract fun outputDirConnection (Lorg/gradle/api/Action;)V public abstract fun packageNamesFromFilePaths (Ljava/lang/String;)V diff --git a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/api/Service.kt b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/api/Service.kt index 1158582cac8..731fca06900 100644 --- a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/api/Service.kt +++ b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/api/Service.kt @@ -3,6 +3,7 @@ package com.apollographql.apollo3.gradle.api import com.android.build.gradle.api.BaseVariant import com.apollographql.apollo3.annotations.ApolloDeprecatedSince import com.apollographql.apollo3.annotations.ApolloDeprecatedSince.Version.v3_0_0 +import com.apollographql.apollo3.annotations.ApolloDeprecatedSince.Version.v3_0_1 import com.apollographql.apollo3.annotations.ApolloExperimental import com.apollographql.apollo3.compiler.OperationIdGenerator import com.apollographql.apollo3.compiler.OperationOutputGenerator @@ -95,17 +96,120 @@ interface Service { val failOnWarnings: Property /** - * For custom scalar types like Date, map from the GraphQL type to the java/kotlin type. + * For custom scalar types like Date, map from the GraphQL type to the Java/Kotlin type. * * Default value: the empty map */ + @Deprecated("Use mapScalar() instead") + @ApolloDeprecatedSince(v3_0_1) val customScalarsMapping: MapProperty @Deprecated("customTypeMapping is a helper property to help migrating to 3.x " + - "and will be removed in a future version", ReplaceWith("customScalarsMapping")) + "and will be removed in a future version. Use mapScalar() instead.") @ApolloDeprecatedSince(v3_0_0) val customTypeMapping: MapProperty + /** + * Map a GraphQL scalar type to the Java/Kotlin type. + * The adapter must be configured at runtime via [com.apollographql.apollo3.ApolloClient.Builder.addCustomScalarAdapter]. + * + * @param graphQLName: the name of the scalar to map as found in the GraphQL schema + * @param targetName: the fully qualified Java or Kotlin name of the type the scalar is mapped to + * + * For example: `mapScalar("Date", "com.example.Date")` + */ + fun mapScalar(graphQLName: String, targetName: String) + + /** + * Map a GraphQL scalar type to the Java/Kotlin type and provided adapter expression. + * The adapter will be configured at compile time and you must not call [com.apollographql.apollo3.ApolloClient.Builder.addCustomScalarAdapter]. + * + * @param graphQLName: the name of the scalar to map as found in the GraphQL schema + * @param targetName: the fully qualified Java or Kotlin name of the type the scalar is mapped to + * @param expression: an expression that will be used by the codegen to get an adapter for the + * given scalar. [expression] is passed verbatim to JavaPoet/KotlinPoet. + * + * For example: + * - `mapScalar("Date", "com.example.Date", "com.example.DateAdapter")` (an instance property or object) + * - `mapScalar("Date", "com.example.Date", "com.example.DateAdapter()")` (create a new instance every time) + */ + fun mapScalar(graphQLName: String, targetName: String, expression: String) + + /** + * Map the given GraphQL scalar to [kotlin.String] and use the builtin adapter + */ + fun mapScalarToKotlinString(graphQLName: String) + + /** + * Map the given GraphQL scalar to [kotlin.Int] and use the builtin adapter + */ + fun mapScalarToKotlinInt(graphQLName: String) + + /** + * Map the given GraphQL scalar to [kotlin.Double] and use the builtin adapter + */ + fun mapScalarToKotlinDouble(graphQLName: String) + + /** + * Map the given GraphQL scalar to [kotlin.Float] and use the builtin adapter + */ + fun mapScalarToKotlinFloat(graphQLName: String) + + /** + * Map the given GraphQL scalar to [kotlin.Long] and use the builtin adapter + */ + fun mapScalarToKotlinLong(graphQLName: String) + + /** + * Map the given GraphQL scalar to [kotlin.Boolean] and use the builtin adapter + */ + fun mapScalarToKotlinBoolean(graphQLName: String) + + /** + * Map the given GraphQL scalar to [kotlin.Any] and use the builtin adapter + */ + fun mapScalarToKotlinAny(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.String] and use the builtin adapter + */ + fun mapScalarToJavaString(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.Integer] and use the builtin adapter + */ + fun mapScalarToJavaInteger(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.Double] and use the builtin adapter + */ + fun mapScalarToJavaDouble(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.Float] and use the builtin adapter + */ + fun mapScalarToJavaFloat(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.Long] and use the builtin adapter + */ + fun mapScalarToJavaLong(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.Boolean] and use the builtin adapter + */ + fun mapScalarToJavaBoolean(graphQLName: String) + + /** + * Map the given GraphQL scalar to [java.lang.Object] and use the builtin adapter + */ + fun mapScalarToJavaObject(graphQLName: String) + + /** + * Map the given GraphQL scalar to [com.apollographql.apollo3.api.Upload] and use the builtin adapter + */ + fun mapScalarToUpload(graphQLName: String) + /** * By default, Apollo uses `Sha256` hashing algorithm to generate an ID for the query. * To provide a custom ID generation logic, pass an `instance` that implements the [OperationIdGenerator]. How the ID is generated is @@ -284,11 +388,20 @@ interface Service { val generateQueryDocument: Property /** - * Whether to generate the __Schema class. The __Schema class lists all composite - * types in order to access __typename and/or possibleTypes + * Whether to generate the Schema class. The Schema class lists all composite + * types in order to access __typename and/or possibleTypes. + * + * Default: false */ val generateSchema: Property + /** + * Class name to use when generating the Schema class. + * + * Default: "__Schema" + */ + val generatedSchemaName: Property + /** * Whether to generate operation variables as [com.apollographql.apollo3.api.Optional] * @@ -395,7 +508,7 @@ interface Service { fun registry(configure: Action) /** - * Configures the [Introspection] + * Configures operation safelisting (requires an [Apollo Studio](https://www.apollographql.com/docs/studio/) account) */ fun registerOperations(configure: Action) diff --git a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/ApolloGenerateSourcesTask.kt b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/ApolloGenerateSourcesTask.kt index 9d6aec44816..a0ca3c67c07 100644 --- a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/ApolloGenerateSourcesTask.kt +++ b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/ApolloGenerateSourcesTask.kt @@ -2,9 +2,10 @@ package com.apollographql.apollo3.gradle.internal import com.apollographql.apollo3.annotations.ApolloExperimental import com.apollographql.apollo3.compiler.APOLLO_VERSION +import com.apollographql.apollo3.compiler.ApolloCompiler import com.apollographql.apollo3.compiler.ApolloMetadata import com.apollographql.apollo3.compiler.CommonMetadata -import com.apollographql.apollo3.compiler.ApolloCompiler +import com.apollographql.apollo3.compiler.ExpressionAdapterInitializer import com.apollographql.apollo3.compiler.IncomingOptions import com.apollographql.apollo3.compiler.IncomingOptions.Companion.resolveSchema import com.apollographql.apollo3.compiler.MODELS_OPERATION_BASED @@ -22,11 +23,14 @@ import com.apollographql.apollo3.compiler.Options.Companion.defaultGenerateQuery import com.apollographql.apollo3.compiler.Options.Companion.defaultGenerateResponseFields import com.apollographql.apollo3.compiler.Options.Companion.defaultGenerateSchema import com.apollographql.apollo3.compiler.Options.Companion.defaultGenerateTestBuilders +import com.apollographql.apollo3.compiler.Options.Companion.defaultGeneratedSchemaName import com.apollographql.apollo3.compiler.Options.Companion.defaultSealedClassesForEnumsMatching import com.apollographql.apollo3.compiler.Options.Companion.defaultUseSchemaPackageNameForFragments import com.apollographql.apollo3.compiler.Options.Companion.defaultUseSemanticNaming import com.apollographql.apollo3.compiler.Options.Companion.defaultWarnOnDeprecatedUsages import com.apollographql.apollo3.compiler.PackageNameGenerator +import com.apollographql.apollo3.compiler.RuntimeAdapterInitializer +import com.apollographql.apollo3.compiler.ScalarInfo import com.apollographql.apollo3.compiler.TargetLanguage import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileCollection @@ -47,6 +51,7 @@ import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.TaskAction +import org.jetbrains.kotlin.gradle.utils.`is` import javax.inject.Inject @CacheableTask @@ -96,7 +101,11 @@ abstract class ApolloGenerateSourcesTask : DefaultTask() { @get:Input @get:Optional - abstract val customScalarsMapping: MapProperty + abstract val scalarTypeMapping: MapProperty + + @get:Input + @get:Optional + abstract val scalarAdapterMapping: MapProperty @get:Input @get:Optional @@ -118,6 +127,10 @@ abstract class ApolloGenerateSourcesTask : DefaultTask() { @get:Optional abstract val generateSchema: Property + @get:Input + @get:Optional + abstract val generatedSchemaName: Property + @get:Input @get:Optional abstract val generateResponseFields: Property @@ -190,32 +203,30 @@ abstract class ApolloGenerateSourcesTask : DefaultTask() { "Apollo: multiple schemas found in metadata" } - val commonMetadata = commonMetadatas.singleOrNull() - var outputCommonMetadata: CommonMetadata? = null + var commonMetadata = commonMetadatas.singleOrNull() + var rememberCommonMetadata = false - val incomingOptions = if (commonMetadata != null) { + if (commonMetadata != null) { check(schemaFiles.files.isEmpty()) { "Specifying 'schemaFiles' has no effect as an upstream module already provided a schema" } check(!codegenModels.isPresent) { "Specifying 'codegenModels' has no effect as an upstream module already provided a codegenModels" } - IncomingOptions.fromMetadata(commonMetadata) + check(scalarTypeMapping.getOrElse(emptyMap()).isEmpty()) { + "Mapping scalars can only be done in the schema module" + } } else { val codegenModels = codegenModels.getOrElse(defaultCodegenModels) val (schema, mainSchemaFilePath) = resolveSchema(schemaFiles.files, rootFolders.get()) - outputCommonMetadata = CommonMetadata( + rememberCommonMetadata = true + commonMetadata = CommonMetadata( schema = schema, codegenModels = codegenModels, schemaPackageName = packageNameGenerator.packageName(mainSchemaFilePath), - pluginVersion = APOLLO_VERSION - ) - - IncomingOptions( - schema = schema, - schemaPackageName = outputCommonMetadata.schemaPackageName, - codegenModels = codegenModels, + pluginVersion = APOLLO_VERSION, + scalarMapping = scalarMapping() ) } @@ -233,16 +244,16 @@ abstract class ApolloGenerateSourcesTask : DefaultTask() { } true } - else -> flattenModels.getOrElse(incomingOptions.codegenModels != MODELS_RESPONSE_BASED) + else -> flattenModels.getOrElse(commonMetadata.codegenModels != MODELS_RESPONSE_BASED) } val codegenModels = when { targetLanguage == TargetLanguage.JAVA -> { - check(incomingOptions.codegenModels == MODELS_OPERATION_BASED) { - "Java codegen does not support codegenModels=${incomingOptions.codegenModels}" + check(commonMetadata.codegenModels == MODELS_OPERATION_BASED) { + "Java codegen does not support codegenModels=${commonMetadata.codegenModels}" } MODELS_OPERATION_BASED } - else -> incomingOptions.codegenModels + else -> commonMetadata.codegenModels } val options = Options( @@ -262,21 +273,22 @@ abstract class ApolloGenerateSourcesTask : DefaultTask() { generateFragmentImplementations = generateFragmentImplementations.getOrElse(defaultGenerateFragmentImplementations), generateQueryDocument = generateQueryDocument.getOrElse(defaultGenerateQueryDocument), generateSchema = generateSchema.getOrElse(defaultGenerateSchema), + generatedSchemaName = generatedSchemaName.getOrElse(defaultGeneratedSchemaName), generateResponseFields = generateResponseFields.getOrElse(defaultGenerateResponseFields), logger = logger, moduleName = projectName.get(), // Response-based models generate a lot of models and therefore a lot of name clashes if flattened flattenModels = flattenModels, incomingCompilerMetadata = metadata.map { it.compilerMetadata }, - schema = incomingOptions.schema, + schema = commonMetadata.schema, codegenModels = codegenModels, - schemaPackageName = incomingOptions.schemaPackageName, + schemaPackageName = commonMetadata.schemaPackageName, useSchemaPackageNameForFragments = useSchemaPackageNameForFragments.getOrElse(defaultUseSchemaPackageNameForFragments), - customScalarsMapping = customScalarsMapping.getOrElse(emptyMap()), + scalarMapping = commonMetadata.scalarMapping, targetLanguage = targetLanguage, generateTestBuilders = generateTestBuilders.getOrElse(defaultGenerateTestBuilders), sealedClassesForEnumsMatching = sealedClassesForEnumsMatching.getOrElse(defaultSealedClassesForEnumsMatching), - generateOptionalOperationVariables = generateOptionalOperationVariables.getOrElse(defaultGenerateOptionalOperationVariables) + generateOptionalOperationVariables = generateOptionalOperationVariables.getOrElse(defaultGenerateOptionalOperationVariables), ) val outputCompilerMetadata = ApolloCompiler.write(options) @@ -284,10 +296,17 @@ abstract class ApolloGenerateSourcesTask : DefaultTask() { val metadataOutputFile = metadataOutputFile.asFile.orNull if (metadataOutputFile != null) { ApolloMetadata( - commonMetadata = outputCommonMetadata, + commonMetadata = if (rememberCommonMetadata) commonMetadata else null, compilerMetadata = outputCompilerMetadata, moduleName = projectName.get() ).writeTo(metadataOutputFile) } } + + private fun scalarMapping(): Map { + return scalarTypeMapping.getOrElse(emptyMap()).mapValues { (graphQLName, targetName) -> + val adapterInitializerExpression = scalarAdapterMapping.getOrElse(emptyMap())[graphQLName] + ScalarInfo(targetName, if (adapterInitializerExpression == null) RuntimeAdapterInitializer else ExpressionAdapterInitializer(adapterInitializerExpression)) + } + } } diff --git a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultApolloExtension.kt b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultApolloExtension.kt index c8c0cce871b..27335de9f9b 100644 --- a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultApolloExtension.kt +++ b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultApolloExtension.kt @@ -4,6 +4,8 @@ import com.apollographql.apollo3.annotations.ApolloExperimental import com.apollographql.apollo3.compiler.OperationIdGenerator import com.apollographql.apollo3.compiler.OperationOutputGenerator import com.apollographql.apollo3.compiler.PackageNameGenerator +import com.apollographql.apollo3.compiler.RuntimeAdapterInitializer +import com.apollographql.apollo3.compiler.ScalarInfo import com.apollographql.apollo3.compiler.TargetLanguage import com.apollographql.apollo3.compiler.capitalizeFirstLetter import com.apollographql.apollo3.gradle.api.AndroidProject @@ -94,6 +96,8 @@ abstract class DefaultApolloExtension( && defaultService.schemaFile.isPresent.not() && defaultService.schemaFiles.isEmpty && defaultService.alwaysGenerateTypesMatching.isPresent.not() + && defaultService.scalarTypeMapping.isEmpty() + && defaultService.scalarAdapterMapping.isEmpty() && defaultService.customScalarsMapping.isPresent.not() && defaultService.customTypeMapping.isPresent.not() && defaultService.excludes.isPresent.not() @@ -292,7 +296,11 @@ abstract class DefaultApolloExtension( maybeRegisterRegisterOperationsTasks(project, service, codegenProvider) } - private fun maybeRegisterRegisterOperationsTasks(project: Project, service: DefaultService, codegenProvider: TaskProvider) { + private fun maybeRegisterRegisterOperationsTasks( + project: Project, + service: DefaultService, + codegenProvider: TaskProvider, + ) { val registerOperationsConfig = service.registerOperationsConfig if (registerOperationsConfig != null) { project.tasks.register(ModelNames.registerApolloOperations(service), ApolloRegisterOperationsTask::class.java) { task -> @@ -418,7 +426,7 @@ abstract class DefaultApolloExtension( if (project.hasKotlinPlugin()) { checkKotlinPluginVersion(project) } - + val generateKotlinModels: Boolean when { service.generateKotlinModels.isPresent -> { @@ -454,8 +462,19 @@ abstract class DefaultApolloExtension( task.targetLanguage.set(targetLanguage) task.warnOnDeprecatedUsages.set(service.warnOnDeprecatedUsages) task.failOnWarnings.set(service.failOnWarnings) + + val scalarTypeMappingFallbackOldSyntax = service.customScalarsMapping.orElse( + service.customTypeMapping + ).getOrElse(emptyMap()) + + check(service.scalarTypeMapping.isEmpty() || scalarTypeMappingFallbackOldSyntax.isEmpty()) { + "Apollo: either mapScalar() or customScalarsMapping can be used, but not both" + } @Suppress("DEPRECATION") - task.customScalarsMapping.set(service.customScalarsMapping.orElse(service.customTypeMapping)) + task.scalarTypeMapping.set( + service.scalarTypeMapping.ifEmpty { scalarTypeMappingFallbackOldSyntax } + ) + task.scalarAdapterMapping.set(service.scalarAdapterMapping) task.outputDir.apply { set(service.outputDir.orElse(BuildDirLayout.outputDir(project, service)).get()) disallowChanges() @@ -508,6 +527,7 @@ abstract class DefaultApolloExtension( task.generateFragmentImplementations.set(service.generateFragmentImplementations) task.generateQueryDocument.set(service.generateQueryDocument) task.generateSchema.set(service.generateSchema) + task.generatedSchemaName.set(service.generatedSchemaName) task.codegenModels.set(service.codegenModels) task.flattenModels.set(service.flattenModels) @OptIn(ApolloExperimental::class) @@ -659,4 +679,7 @@ abstract class DefaultApolloExtension( }.toSet() } } + + private fun Map.asScalarInfoMapping(): Map = + mapValues { (_, value) -> ScalarInfo(value, RuntimeAdapterInitializer) } } diff --git a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultService.kt b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultService.kt index df39092bf7b..5a3ffbdad65 100644 --- a/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultService.kt +++ b/apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo3/gradle/internal/DefaultService.kt @@ -18,6 +18,7 @@ abstract class DefaultService @Inject constructor(val project: Project, override : Service { val objects = project.objects + init { @Suppress("LeakingThis") if (GradleVersion.current() >= GradleVersion.version("6.2")) { @@ -125,13 +126,50 @@ abstract class DefaultService @Inject constructor(val project: Project, override override fun packageNamesFromFilePaths(rootPackageName: String?) { packageNameGenerator.set( - project.provider { - PackageNameGenerator.FilePathAware( - roots = Roots(graphqlSourceDirectorySet.srcDirs), - rootPackageName = rootPackageName ?: "" - ) - } + project.provider { + PackageNameGenerator.FilePathAware( + roots = Roots(graphqlSourceDirectorySet.srcDirs), + rootPackageName = rootPackageName ?: "" + ) + } ) packageNameGenerator.disallowChanges() } + + val scalarTypeMapping = mutableMapOf() + val scalarAdapterMapping = mutableMapOf() + + override fun mapScalar( + graphQLName: String, + targetName: String, + ) { + scalarTypeMapping[graphQLName] = targetName + } + + override fun mapScalar( + graphQLName: String, + targetName: String, + expression: String, + ) { + scalarTypeMapping[graphQLName] = targetName + scalarAdapterMapping[graphQLName] = expression + } + + override fun mapScalarToKotlinString(graphQLName: String) = mapScalar(graphQLName, "kotlin.String", "com.apollographql.apollo3.api.StringAdapter") + override fun mapScalarToKotlinInt(graphQLName: String) = mapScalar(graphQLName, "kotlin.Int", "com.apollographql.apollo3.api.IntAdapter") + override fun mapScalarToKotlinDouble(graphQLName: String) = mapScalar(graphQLName, "kotlin.Double", "com.apollographql.apollo3.api.DoubleAdapter") + override fun mapScalarToKotlinFloat(graphQLName: String) = mapScalar(graphQLName, "kotlin.Float", "com.apollographql.apollo3.api.FloatAdapter") + override fun mapScalarToKotlinLong(graphQLName: String) = mapScalar(graphQLName, "kotlin.Long", "com.apollographql.apollo3.api.LongAdapter") + override fun mapScalarToKotlinBoolean(graphQLName: String) = mapScalar(graphQLName, "kotlin.Boolean", "com.apollographql.apollo3.api.BooleanAdapter") + override fun mapScalarToKotlinAny(graphQLName: String) = mapScalar(graphQLName, "kotlin.Any", "com.apollographql.apollo3.api.AnyAdapter") + + override fun mapScalarToJavaString(graphQLName: String) = mapScalar(graphQLName, "java.lang.String", "com.apollographql.apollo3.api.StringAdapter") + override fun mapScalarToJavaInteger(graphQLName: String) = mapScalar(graphQLName, "java.lang.Integer", "com.apollographql.apollo3.api.IntAdapter") + override fun mapScalarToJavaDouble(graphQLName: String) = mapScalar(graphQLName, "java.lang.Double", "com.apollographql.apollo3.api.DoubleAdapter") + override fun mapScalarToJavaFloat(graphQLName: String) = mapScalar(graphQLName, "java.lang.Float", "com.apollographql.apollo3.api.FloatAdapter") + override fun mapScalarToJavaLong(graphQLName: String) = mapScalar(graphQLName, "java.lang.Long", "com.apollographql.apollo3.api.LongAdapter") + override fun mapScalarToJavaBoolean(graphQLName: String) = mapScalar(graphQLName, "java.lang.Boolean", "com.apollographql.apollo3.api.BooleanAdapter") + override fun mapScalarToJavaObject(graphQLName: String) = mapScalar(graphQLName, "java.lang.Object", "com.apollographql.apollo3.api.AnyAdapter") + + override fun mapScalarToUpload(graphQLName: String) = mapScalar(graphQLName, "com.apollographql.apollo3.api.Upload", "com.apollographql.apollo3.api.UploadAdapter") } diff --git a/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/MultiModulesTests.kt b/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/MultiModulesTests.kt index 870839acc3e..5aaf5fb9650 100644 --- a/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/MultiModulesTests.kt +++ b/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/MultiModulesTests.kt @@ -47,7 +47,7 @@ class MultiModulesTests { try { TestUtils.executeTask(":node1:generateApolloSources", dir) fail("the build did not detect duplicate classes") - } catch(e: UnexpectedBuildFailure) { + } catch (e: UnexpectedBuildFailure) { Truth.assertThat(e.message).contains("duplicate") Truth.assertThat(e.message).contains("in modules: node1,node2") } @@ -78,10 +78,22 @@ class MultiModulesTests { assertTrue(File(dir, "root/build/generated/source/apollo/service/com/library/type/Date.kt").exists()) // Leaf metadata doesn't contain anything regarding Date val metadata = ApolloMetadata.readFrom(File(dir, "leaf/build/generated/metadata/apollo/service/metadata.json")) - Truth.assertThat(metadata.compilerMetadata.resolverInfo.entries.map {it.key.id}).doesNotContain("Date") + Truth.assertThat(metadata.compilerMetadata.resolverInfo.entries.map { it.key.id }).doesNotContain("Date") // But contains GeoPoint - Truth.assertThat(metadata.compilerMetadata.resolverInfo.entries.map {it.key.id}).doesNotContain("Date") + Truth.assertThat(metadata.compilerMetadata.resolverInfo.entries.map { it.key.id }).doesNotContain("Date") assertTrue(File(dir, "leaf/build/generated/source/apollo/service/com/library/type/GeoPoint.kt").exists()) } } -} \ No newline at end of file + + @Test + fun `scalar mapping can only be registered in the schema module`() { + TestUtils.withTestProject("multi-modules-custom-scalar-defined-in-leaf") { dir -> + try { + TestUtils.executeTaskAndAssertSuccess(":leaf:assemble", dir) + fail("the build did not detect scalar mapping registered in leaf module") + } catch (e: UnexpectedBuildFailure) { + Truth.assertThat(e.message).contains("Mapping scalars can only be done in the schema module") + } + } + } +} diff --git a/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/ServiceTests.kt b/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/ServiceTests.kt index 1d5b3b8d65b..7709f067677 100644 --- a/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/ServiceTests.kt +++ b/apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo3/gradle/test/ServiceTests.kt @@ -34,6 +34,24 @@ class ServiceTests { } } + @Test + fun `customScalarsMapping and mapScalar trigger an error`() { + withSimpleProject(""" + apollo { + packageNamesFromFilePaths() + customScalarsMapping = ["DateTime": "java.util.Date"] + mapScalar("DateTime", "java.util.Date") + } + """.trimIndent()) { dir -> + try { + TestUtils.executeTask("generateApolloSources", dir) + fail("an exception was expected") + } catch (e: UnexpectedBuildFailure) { + Truth.assertThat(e.message).contains("either mapScalar() or customScalarsMapping") + } + } + } + @Test fun `registering an unknown custom scalar fails`() { withSimpleProject(""" diff --git a/apollo-gradle-plugin/testProjects/java-only/README.md b/apollo-gradle-plugin/testProjects/java-only/README.md new file mode 100644 index 00000000000..6b0cf4fd48a --- /dev/null +++ b/apollo-gradle-plugin/testProjects/java-only/README.md @@ -0,0 +1 @@ +A test project that does not apply the Kotlin plugin and generates Java models \ No newline at end of file diff --git a/apollo-gradle-plugin/testProjects/java-only/build.gradle.kts b/apollo-gradle-plugin/testProjects/java-only/build.gradle.kts index 2418848327f..c10d92d0172 100644 --- a/apollo-gradle-plugin/testProjects/java-only/build.gradle.kts +++ b/apollo-gradle-plugin/testProjects/java-only/build.gradle.kts @@ -9,4 +9,6 @@ apply(plugin = "com.apollographql.apollo3") configure { packageName.set("com.example") + mapScalarToJavaLong("Long") + mapScalar("ID", "java.lang.Long", "com.example.Adapters.ID_ADAPTER") } diff --git a/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/operation.graphql b/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/operation.graphql index ac48d4cf6a5..640a8bd4226 100644 --- a/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/operation.graphql +++ b/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/operation.graphql @@ -1,3 +1,7 @@ query GetRandom { + nullableLong + long + nullableId + id random -} \ No newline at end of file +} diff --git a/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/schema.graphqls b/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/schema.graphqls index cfa6a5058bc..b88ee1d683c 100644 --- a/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/schema.graphqls +++ b/apollo-gradle-plugin/testProjects/java-only/src/main/graphql/schema.graphqls @@ -1,3 +1,9 @@ +scalar Long + type Query { + nullableLong: Long + long: Long! + nullableId: ID + id: ID! random: String -} \ No newline at end of file +} diff --git a/apollo-gradle-plugin/testProjects/java-only/src/main/java/com/example/Adapters.java b/apollo-gradle-plugin/testProjects/java-only/src/main/java/com/example/Adapters.java new file mode 100644 index 00000000000..cd5d07fd436 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/java-only/src/main/java/com/example/Adapters.java @@ -0,0 +1,18 @@ +packate com.example; + +import com.apollographql.apollo3.api.* +import com.apollographql.apollo3.api.json.* + +public class Adapters { + public static final Adapter = new Adapter() { + @Override + public Long fromJson (JsonReader reader, CustomScalarAdapters customScalarAdapters) throws IOException { + return reader.nextLong(); + } + + @Override + public void toJson (JsonWriter writer, CustomScalarAdapters customScalarAdapters, Long value) throws IOException { + writer.value(value); + } + }; +} diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/build.gradle.kts b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/build.gradle.kts new file mode 100644 index 00000000000..dfd7e4f34e2 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/build.gradle.kts @@ -0,0 +1,3 @@ +buildscript { + apply(from = "../../testProjects/buildscript.gradle.kts") +} diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/leaf/build.gradle.kts b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/leaf/build.gradle.kts new file mode 100644 index 00000000000..a42bd70b747 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/leaf/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + kotlin("jvm") + id("com.apollographql.apollo3") +} + +dependencies { + implementation(kotlin("stdlib")) + implementation(groovy.util.Eval.x(project, "x.dep.apollo.api")) + testImplementation(kotlin("test-junit")) + + implementation(project(":root")) + apolloMetadata(project(":root")) +} + +apollo { + packageName.set("com.library") + mapScalar("Long", "java.lang.Long") +} diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/leaf/src/main/graphql/com/library/operations.graphql b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/leaf/src/main/graphql/com/library/operations.graphql new file mode 100644 index 00000000000..de0324cba1e --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/leaf/src/main/graphql/com/library/operations.graphql @@ -0,0 +1,4 @@ +query GetGeoPoint { + date + long +} diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/build.gradle.kts b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/build.gradle.kts new file mode 100644 index 00000000000..7c5dec33a29 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + kotlin("jvm") + id("com.apollographql.apollo3") +} + +dependencies { + implementation(kotlin("stdlib")) + implementation(groovy.util.Eval.x(project, "x.dep.apollo.api")) + + testImplementation(kotlin("test-junit")) +} + +apollo { + packageName.set("com.library") + generateApolloMetadata.set(true) + mapScalar("Date", "java.util.Date") +} diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/src/main/graphql/com/library/operations.graphql b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/src/main/graphql/com/library/operations.graphql new file mode 100644 index 00000000000..23803f12c88 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/src/main/graphql/com/library/operations.graphql @@ -0,0 +1 @@ +# No operations here but we set the Date customScalarMapping in build.gradle.kts so we expect Date to be generated \ No newline at end of file diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/src/main/graphql/com/library/schema.sdl b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/src/main/graphql/com/library/schema.sdl new file mode 100644 index 00000000000..539b6511685 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/root/src/main/graphql/com/library/schema.sdl @@ -0,0 +1,7 @@ +type Query { + date: Date! + long: Long! +} + +scalar Date +scalar Long diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/settings.gradle.kts b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/settings.gradle.kts new file mode 100644 index 00000000000..f2b8237ed41 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar-defined-in-leaf/settings.gradle.kts @@ -0,0 +1,3 @@ +rootProject.name = "multi-modules" + +include(":root", ":leaf") diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/leaf/src/main/graphql/com/library/operations.graphql b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/leaf/src/main/graphql/com/library/operations.graphql index a8d0532c0d9..52b7fda548d 100644 --- a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/leaf/src/main/graphql/com/library/operations.graphql +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/leaf/src/main/graphql/com/library/operations.graphql @@ -1,3 +1,4 @@ query GetGeoPoint { + id geoPoint -} \ No newline at end of file +} diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/build.gradle.kts b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/build.gradle.kts index 8828ae26742..b229615cb26 100644 --- a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/build.gradle.kts +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/build.gradle.kts @@ -14,5 +14,6 @@ dependencies { apollo { packageName.set("com.library") generateApolloMetadata.set(true) - customScalarsMapping.set(mapOf("Date" to "java.util.Date")) + mapScalar("Date", "java.util.Date") + mapScalar("ID", "com.library.MyID", "com.library.MyIDAdapter()") } diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/graphql/com/library/schema.sdl b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/graphql/com/library/schema.sdl index 9aaecebb789..85ed37c05e3 100644 --- a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/graphql/com/library/schema.sdl +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/graphql/com/library/schema.sdl @@ -1,7 +1,8 @@ type Query { + id: ID! date: Date! geoPoint: GeoPoint! } scalar Date -scalar GeoPoint \ No newline at end of file +scalar GeoPoint diff --git a/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/kotlin/Scalars.kt b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/kotlin/Scalars.kt new file mode 100644 index 00000000000..3ee8e503dc3 --- /dev/null +++ b/apollo-gradle-plugin/testProjects/multi-modules-custom-scalar/root/src/main/kotlin/Scalars.kt @@ -0,0 +1,16 @@ +package com.library + +import com.apollographql.apollo3.api.* +import com.apollographql.apollo3.api.json.* + +class MyID(val id: String) + +class MyIDAdapter() : Adapter { + override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): MyID { + return MyID(reader.nextString()!!) + } + + override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: MyID) { + writer.value(value.id) + } +} diff --git a/design-docs/Scalar adapter configuration.md b/design-docs/Scalar adapter configuration.md new file mode 100644 index 00000000000..4daa9afee08 --- /dev/null +++ b/design-docs/Scalar adapter configuration.md @@ -0,0 +1,205 @@ +# Scalar mapping and adapter configuration improvements + +This outlines thoughts and suggested improvements to the configuration of Scalar adapters, +following [this request](https://github.com/apollographql/apollo-kotlin/issues/3748). + +## Current situation + +### User facing API + +Documentation is [here](https://www.apollographql.com/docs/kotlin/essentials/custom-scalars/). + +Custom scalars need: + +- declaring the mapping [GraphQL name] → [Kotlin class name], in the Gradle plugin + configuration (`customScalarsMapping`) +- registering the adapters to use [GraphQL type (generated)] → [adapter instance], + on `ApolloClient` (`addCustomScalarAdapter`) + +### How it works + +`Service.kt`: + +```kotlin +/** + * For custom scalar types like Date, map from the GraphQL type to the java/kotlin type. + * + * Default value: the empty map + */ +val customScalarsMapping: MapProperty +``` + +Used to generate the wanted type in generated models / adapters (`kotlin.Any` is used by default when no mapping is +specified). + +A “Type” class is also generated. + +Example: + +```kotlin +public class MyDate { + public companion object { + public val type: CustomScalarType = CustomScalarType("MyDate", "com.example.MyDate") + } +} +``` + +In the generated `ResponseAdapter` and `VariablesAdapter` objects, the registered scalar adapter is found in +the `customScalarAdapters` parameter, like so: + +```kotlin +public override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): + GetDateQuery.Data { +// ... + 3 -> date = customScalarAdapters.responseAdapterFor(com.example.type.MyDate.type).nullable().fromJson(reader, customScalarAdapters) +// ... +``` + +(`AnyAdapter` is used by default when no mapping is declared). + +Whereas, for **built-in** scalars (e.g. `ID` and `String`), the type and adapter to use are hard-coded in the generated +code: + +```kotlin +2 -> id = StringAdapter.fromJson(reader, customScalarAdapters) +``` + +The hardcoded types / adapters for built-in scalars are +in [`KotlinResolver`](https://github.com/apollographql/apollo-kotlin/blob/main/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/kotlin/KotlinResolver.kt#L26) +and [`JavaResolver`](https://github.com/apollographql/apollo-kotlin/blob/main/apollo-compiler/src/main/kotlin/com/apollographql/apollo3/compiler/codegen/java/JavaResolver.kt) +. + +The `customScalarAdapters` comes from what is configured on the `ApolloClient` at runtime by the user. It is passed to +requests (in the `executionContext`), and then to the adapters in `HttpNetworkTransport` / `WebSocketNetworkTransport`. + +## Proposed changes + +1. Add the ability to specify an adapter in addition to the type class name when declaring the scalar + mappings in the plugin configuration +2. Allow declaring mappings for built-in scalars (e.g. `ID`) + +### User facing API + +Plugin configuration: + +```kotlin +apollo { + mapScalar("MyDate", "com.example.MyDate", "com.example.MyDateAdapter()") + + mapScalar("ID", "kotlin.Long", "com.apollographql.apollo3.api.LongAdapter") + + mapScalar("MyLong", "kotlin.Long") +} +``` + +`mapScalar`'s signatures: + +```kotlin +/** + * Map a GraphQL scalar type to the Java/Kotlin type. + * The adapter must be configured at runtime via `ApolloClient.Builder.addCustomScalarAdapter()`. + * + * For example: `mapScalar("Date", "com.example.Date")` + */ +fun mapScalar(graphQLName: String, targetName: String) + +/** + * Map a GraphQL scalar type to the Java/Kotlin type and provided adapter expression. + * + * For example: + * - `mapScalar("Date", "com.example.Date", "com.example.DateAdapter")` (an instance property or object) + * - `mapScalar("Date", "com.example.Date", "com.example.DateAdapter()")` (instantiate the class on the fly) + */ +fun mapScalar(graphQLName: String, targetName: String, expression: String) +``` + +Let's also have convenience shortcuts for the types for which we have built-in adapters: + +```kotlin +apollo { + // equivalent to mapScalar("ID", "kotlin.Long", "com.apollographql.apollo3.api.LongAdapter") + mapScalarToKotlinLong("ID") + + // equivalent to mapScalar("ID", "java.lang.Long", "com.apollographql.apollo3.api.LongAdapter") + mapScalarToJavaLong("ID") + + // equivalent to mapScalar("Json", "kotlin.Any", "com.apollographql.apollo3.api.AnyAdapter") + mapScalarToKotlinAny("Json") + + // etc. +``` + +With this, it is no longer necessary (but still possible) to register the adapters at runtime with `addCustomScalarAdapter`. + +#### Compatibility + +We need to keep the current mechanism (`customScalarsMapping` + `addCustomScalarAdapter`) working of course. + +Let's make `customScalarsMapping` call `mapScalar` internally and mark it as deprecated. + +### Code changes + +#### Use the mapping info to generate the code + +In `ResponseAdapter` and `VariablesAdapter` code generation, we now have more cases to handle to reference the scalar adapter to use: + +``` +if (an Adapter for the scalar is registered with ExpressionAdapterInitializer) { + Output the adapter with the expression as-is +} else if (an Adapter for the scalar is registered with RuntimeAdapterInitializer) { + Output the code to lookup the adapter in `customScalarAdapters` +} else if (the scalar is a built-in (e.g. `ID`)) { + Output the appropriate adapter (same as current behavior) +} else { + Output the code to lookup the adapter in `customScalarAdapters` + Note: this is the fallback to current behavior +} +``` + +Generated code will look like this: + +```kotlin +public override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): + GetDateQuery.Data { +// ... + +// Before: + 0 -> myDate = customScalarAdapters.responseAdapterFor(com.example.type.MyDate.type).nullable().fromJson(reader, customScalarAdapters) + 1 -> id = StringAdapter.fromJson(reader, customScalarAdapters) + 2 -> myLong = customScalarAdapters.responseAdapterFor(MyLong.type).nullable().fromJson(reader, customScalarAdapters) + +// After: + 0 -> myDate = com.example.MyDateAdapter().nullable().fromJson(reader, customScalarAdapters) + 1 -> id = com.apollographql.apollo3.api.LongAdapter.fromJson(reader, customScalarAdapters) + 2 -> myLong = StringAdapter.fromJson(reader, customScalarAdapters) + +// ... +``` + +#### Update and store mapping information + +A sealed interface is used to account for the ways adapters can be configured: + +```kotlin +sealed interface AdapterInitializer + +/** + * The adapter expression will be used as-is (can be an object, a public val, a class instantiation). + * + * e.g. `"com.example.MyAdapter"` or `"com.example.MyAdapter()"`. + */ +class ExpressionAdapterInitializer(val expression: String) : AdapterInitializer + +/** + * The adapter instance will be looked up in the [com.apollographql.apollo3.api.CustomScalarAdapters] provided at runtime. + */ +object RuntimeAdapterInitializer : AdapterInitializer +``` + +Currently, `customScalarsMapping` in `IrBuilder` (and `Options`) is a `Map` (GraphQL name -> Java/Kotlin type). + +Let's change it to a `Map`, with `ScalarInfo` being `data class ScalarInfo(val targetName: String, val adapterInitializer: AdapterInitializer)`. + +We need to pass it to `KotlinResolver` / `JavaResolver` because this is where the logic to get the adapter lies (`adapterInitializer()`, `nonNullableAdapterInitializer()`). + +This can be done by passing it to `KotlinCodeGen` / `JavaCodeGen` which instantiate the resolvers. diff --git a/tests/custom-scalars/build.gradle.kts b/tests/custom-scalars/build.gradle.kts deleted file mode 100644 index 3017dbcc3a3..00000000000 --- a/tests/custom-scalars/build.gradle.kts +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id("org.jetbrains.kotlin.jvm") - id("com.apollographql.apollo3") -} - -dependencies { - implementation("com.apollographql.apollo3:apollo-runtime") - testImplementation("com.apollographql.apollo3:apollo-testing-support") - testImplementation(groovy.util.Eval.x(project, "x.dep.kotlinJunit")) -} - -apollo { - packageName.set("custom.scalars") - customScalarsMapping.put("Long", "kotlin.Long") - customScalarsMapping.put("CustomFloat", "kotlin.Float") - customScalarsMapping.put("Any", "kotlin.Any") - customScalarsMapping.put("GeoPoint", "kotlin.Any") - customScalarsMapping.put("Address", "custom.scalars.Address") -} \ No newline at end of file diff --git a/tests/custom-scalars/src/main/graphql/operation.graphql b/tests/custom-scalars/src/main/graphql/operation.graphql deleted file mode 100644 index 8c43e1b64b2..00000000000 --- a/tests/custom-scalars/src/main/graphql/operation.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query GetAll { - long - float - any - geoPoints -} - -query GetAddress { - address -} \ No newline at end of file diff --git a/tests/custom-scalars/src/main/graphql/schema.graphqls b/tests/custom-scalars/src/main/graphql/schema.graphqls deleted file mode 100644 index a1ddae208fb..00000000000 --- a/tests/custom-scalars/src/main/graphql/schema.graphqls +++ /dev/null @@ -1,14 +0,0 @@ -scalar CustomFloat -scalar Long -scalar Any -scalar GeoPoint -scalar Address - -type Query { - float: CustomFloat - long: Long - any: Any - geoPoints: [GeoPoint] - address: Address -} - diff --git a/tests/integration-tests/src/commonTest/kotlin/test/schema/TypesTest.kt b/tests/integration-tests/src/commonTest/kotlin/test/schema/TypesTest.kt index aba0ebdaf95..6754ed0656f 100644 --- a/tests/integration-tests/src/commonTest/kotlin/test/schema/TypesTest.kt +++ b/tests/integration-tests/src/commonTest/kotlin/test/schema/TypesTest.kt @@ -23,4 +23,4 @@ class TypesTest { __Schema.possibleTypes(Animal.type).toSet() ) } -} \ No newline at end of file +} diff --git a/tests/scalar-adapters/build.gradle.kts b/tests/scalar-adapters/build.gradle.kts new file mode 100644 index 00000000000..8059824729c --- /dev/null +++ b/tests/scalar-adapters/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("org.jetbrains.kotlin.jvm") + id("com.apollographql.apollo3") +} + +dependencies { + implementation("com.apollographql.apollo3:apollo-runtime") + testImplementation("com.apollographql.apollo3:apollo-testing-support") + testImplementation(groovy.util.Eval.x(project, "x.dep.kotlinJunit")) +} + +apollo { + packageName.set("custom.scalars") + mapScalar("Long", "kotlin.Long") + mapScalarToKotlinFloat("CustomFloat") + mapScalar("Any", "kotlin.Any") + mapScalar("GeoPoint", "kotlin.Any") + mapScalar("Address", "custom.scalars.Address") + mapScalar("ID", "kotlin.Long") + mapScalar("Int", "kotlin.Int", "custom.scalars.MyIntAdapter()") + mapScalar("String", "kotlin.String", "custom.scalars.MyStringAdapter") +} diff --git a/tests/scalar-adapters/src/main/graphql/operation.graphql b/tests/scalar-adapters/src/main/graphql/operation.graphql new file mode 100644 index 00000000000..f804343a5ac --- /dev/null +++ b/tests/scalar-adapters/src/main/graphql/operation.graphql @@ -0,0 +1,20 @@ +query GetAll { + id + nullableId + long + float + any + geoPoints + string + nullableString + int + nullableInt + boolean + nullableBoolean + notMapped + nullableNotMapped +} + +query GetAddress { + address +} diff --git a/tests/scalar-adapters/src/main/graphql/schema.graphqls b/tests/scalar-adapters/src/main/graphql/schema.graphqls new file mode 100644 index 00000000000..cec73ae8423 --- /dev/null +++ b/tests/scalar-adapters/src/main/graphql/schema.graphqls @@ -0,0 +1,25 @@ +scalar CustomFloat +scalar Long +scalar Any +scalar GeoPoint +scalar Address +scalar NotMapped + +type Query { + float: CustomFloat + long: Long + any: Any + geoPoints: [GeoPoint] + address: Address + id: ID! + nullableId: ID + string: String! + nullableString: String + int: Int! + nullableInt: Int + boolean: Boolean! + nullableBoolean: Boolean + notMapped: NotMapped! + nullableNotMapped: NotMapped +} + diff --git a/tests/custom-scalars/src/main/kotlin/custom/scalars/Address.kt b/tests/scalar-adapters/src/main/kotlin/custom/scalars/Address.kt similarity index 100% rename from tests/custom-scalars/src/main/kotlin/custom/scalars/Address.kt rename to tests/scalar-adapters/src/main/kotlin/custom/scalars/Address.kt diff --git a/tests/scalar-adapters/src/main/kotlin/custom/scalars/MyIntAdapter.kt b/tests/scalar-adapters/src/main/kotlin/custom/scalars/MyIntAdapter.kt new file mode 100644 index 00000000000..9f5809745f8 --- /dev/null +++ b/tests/scalar-adapters/src/main/kotlin/custom/scalars/MyIntAdapter.kt @@ -0,0 +1,16 @@ +package custom.scalars + +import com.apollographql.apollo3.api.Adapter +import com.apollographql.apollo3.api.CustomScalarAdapters +import com.apollographql.apollo3.api.json.JsonReader +import com.apollographql.apollo3.api.json.JsonWriter + +class MyIntAdapter : Adapter { + override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): Int { + return reader.nextInt() + } + + override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: Int) { + writer.value(value) + } +} diff --git a/tests/scalar-adapters/src/main/kotlin/custom/scalars/MyStringAdapter.kt b/tests/scalar-adapters/src/main/kotlin/custom/scalars/MyStringAdapter.kt new file mode 100644 index 00000000000..9a9f3b4a68a --- /dev/null +++ b/tests/scalar-adapters/src/main/kotlin/custom/scalars/MyStringAdapter.kt @@ -0,0 +1,16 @@ +package custom.scalars + +import com.apollographql.apollo3.api.Adapter +import com.apollographql.apollo3.api.CustomScalarAdapters +import com.apollographql.apollo3.api.json.JsonReader +import com.apollographql.apollo3.api.json.JsonWriter + +val MyStringAdapter = object : Adapter { + override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): String { + return reader.nextString()!! + } + + override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: String) { + writer.value(value) + } +} diff --git a/tests/custom-scalars/src/test/kotlin/test/CustomScalarTest.kt b/tests/scalar-adapters/src/test/kotlin/test/CustomScalarTest.kt similarity index 73% rename from tests/custom-scalars/src/test/kotlin/test/CustomScalarTest.kt rename to tests/scalar-adapters/src/test/kotlin/test/CustomScalarTest.kt index 1c8f0805bcd..f339b40a442 100644 --- a/tests/custom-scalars/src/test/kotlin/test/CustomScalarTest.kt +++ b/tests/scalar-adapters/src/test/kotlin/test/CustomScalarTest.kt @@ -11,6 +11,7 @@ import custom.scalars.GetAddressQuery import custom.scalars.GetAllQuery import org.junit.Test import kotlin.test.assertEquals +import kotlin.test.assertNull class CustomScalarTest { @Test @@ -19,13 +20,23 @@ class CustomScalarTest { server.enqueue(""" { "data": { + "id": "1", + "nullableId": null, "long": 10000000000, "float": 1.4, "any": { "key": "value" }, "geoPoints": [ { "lat": 1, "lon": 2 }, { "lat": 3, "lon": 4 } - ] + ], + "string": "string", + "nullableString": null, + "int": 1, + "nullableInt": null, + "boolean": true, + "nullableBoolean": null, + "notMapped": { "key": "value" }, + "nullableNotMapped": null } } """.trimIndent()) @@ -34,14 +45,23 @@ class CustomScalarTest { .query(GetAllQuery()) .execute() .dataAssertNoErrors - - assertEquals(10_000_000_000, data.long) + assertEquals(1L, data.id) + assertNull(data.nullableId) + assertEquals(10_000_000_000L, data.long) assertEquals(1.4f, data.float) assertEquals(mapOf("key" to "value"), data.any) assertEquals(listOf( mapOf("lat" to 1, "lon" to 2), mapOf("lat" to 3, "lon" to 4), ), data.geoPoints) + assertEquals("string", data.string) + assertNull(data.nullableString) + assertEquals(1, data.int) + assertNull(data.nullableInt) + assertEquals(true, data.boolean) + assertNull(data.nullableBoolean) + assertEquals(mapOf("key" to "value"), data.notMapped) + assertNull(data.nullableNotMapped) } @Test @@ -58,9 +78,9 @@ class CustomScalarTest { } """.trimIndent()) - val customTypeAdapter = object: CustomTypeAdapter
{ + val customTypeAdapter = object : CustomTypeAdapter
{ override fun decode(value: CustomTypeValue<*>): Address { - check (value is CustomTypeValue.GraphQLJsonObject) + check(value is CustomTypeValue.GraphQLJsonObject) /** * XXX: For consistency, a [CustomTypeValue.GraphQLJsonObject] should contain `GraphQLFoo`