Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .idea/runConfigurations/CodegenTest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions .idea/runConfigurations/ValidationTest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions build-logic/src/main/kotlin/api.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ fun Project.apolloLibrary(
configurePublishing()
}

// Within the 'tests' project (a composite build), dependencies are automatically substituted to use the project's one.
// But we don't want this, for example apollo-tooling depends on a published version of apollo-api.
// So disable this behavior (see https://docs.gradle.org/current/userguide/composite_builds.html#deactivate_included_build_substitutions).
configurations.configureEach {
if (name != "apolloPublished") {
return@configureEach
if (name == "apolloPublished" || name.matches(Regex("apollo.*Compiler"))) {
// Within the 'tests' project (a composite build), dependencies are automatically substituted to use the project's one.
// apollo-tooling depends on a published version of apollo-api which should not be substituted for both the runtime
// and compiler classpaths.
// See (see https://docs.gradle.org/current/userguide/composite_builds.html#deactivate_included_build_substitutions).
this.resolutionStrategy.useGlobalDependencySubstitutionRules.set(false)
}
resolutionStrategy.useGlobalDependencySubstitutionRules.set(false)
}

if (extensions.findByName("kotlin") is KotlinMultiplatformExtension) {
Expand Down
210 changes: 0 additions & 210 deletions design-docs/Scalar adapter configuration.md

This file was deleted.

2 changes: 1 addition & 1 deletion libraries/apollo-ast/api/apollo-ast.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ final class com.apollographql.apollo.ast/GQLInputValueDefinition : com.apollogra
constructor <init>(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String?, kotlin/String, kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective>, com.apollographql.apollo.ast/GQLType, com.apollographql.apollo.ast/GQLValue?) // com.apollographql.apollo.ast/GQLInputValueDefinition.<init>|<init>(com.apollographql.apollo.ast.SourceLocation?;kotlin.String?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirective>;com.apollographql.apollo.ast.GQLType;com.apollographql.apollo.ast.GQLValue?){}[0]

final val children // com.apollographql.apollo.ast/GQLInputValueDefinition.children|{}children[0]
final fun <get-children>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective> // com.apollographql.apollo.ast/GQLInputValueDefinition.children.<get-children>|<get-children>(){}[0]
final fun <get-children>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLNode> // com.apollographql.apollo.ast/GQLInputValueDefinition.children.<get-children>|<get-children>(){}[0]
final val defaultValue // com.apollographql.apollo.ast/GQLInputValueDefinition.defaultValue|{}defaultValue[0]
final fun <get-defaultValue>(): com.apollographql.apollo.ast/GQLValue? // com.apollographql.apollo.ast/GQLInputValueDefinition.defaultValue.<get-defaultValue>|<get-defaultValue>(){}[0]
final val description // com.apollographql.apollo.ast/GQLInputValueDefinition.description|{}description[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ class Schema internal constructor(
@ApolloExperimental
const val FIELD_POLICY_PAGINATION_ARGS = "paginationArgs"

@ApolloExperimental
const val MAP = "map"

@ApolloExperimental
const val MAP_TO = "mapTo"

/**
* Parses the given [map] and creates a new [Schema].
* The [map] must come from a previous call to [toMap] to make sure the schema is valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ class GQLInputValueDefinition(
val defaultValue: GQLValue?,
) : GQLNode, GQLDescribed, GQLNamed, GQLHasDirectives {

override val children = directives
override val children: List<GQLNode> = directives + type + listOfNotNull(defaultValue)

/**
* @param inline whether the input value definition is used inline (for an example a field argument)
Expand Down Expand Up @@ -1217,7 +1217,9 @@ class GQLInputValueDefinition(

override fun copyWithNewChildrenInternal(container: NodeContainer): GQLNode {
return copy(
directives = container.take()
directives = container.take(),
type = container.takeSingle()!!,
defaultValue = container.takeSingle()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,5 @@ fun GQLFieldDefinition.findSemanticNonNulls(schema: Schema): List<Int> {
}
return semanticNonNull.getArgumentValueOrDefault("levels", schema)!!.toListOfInt()
}


Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import com.apollographql.apollo.annotations.ApolloExperimental
import com.apollographql.apollo.annotations.ApolloInternal
import com.apollographql.apollo.ast.internal.ExtensionsMerger
import com.apollographql.apollo.ast.internal.builtinsDefinitionsStr
import com.apollographql.apollo.ast.internal.compilerOptions_0_0
import com.apollographql.apollo.ast.internal.kotlinLabsDefinitions_0_3
import com.apollographql.apollo.ast.internal.kotlinLabsDefinitions_0_4
import com.apollographql.apollo.ast.internal.kotlinLabsDefinitions_0_5
import com.apollographql.apollo.ast.internal.linkDefinitionsStr
import com.apollographql.apollo.ast.internal.nullabilityDefinitionsStr
import okio.Buffer
Expand Down Expand Up @@ -127,6 +129,8 @@ fun kotlinLabsDefinitions(version: String): List<GQLDefinition> {
"v0.2", "v0.3" -> kotlinLabsDefinitions_0_3
// v0.4 doesn't have `@nonnull`
"v0.4" -> kotlinLabsDefinitions_0_4
// v0.5 adds `@map` and `@mapTo`
"v0.5" -> kotlinLabsDefinitions_0_5
else -> error("kotlin_labs/$version definitions are not supported, please use $AUTO_IMPORTED_KOTLIN_LABS_VERSION")
})
}
Expand All @@ -143,7 +147,9 @@ fun builtinForeignSchemas(): List<ForeignSchema> {
ForeignSchema("kotlin_labs", "v0.2", kotlinLabsDefinitions("v0.2"), listOf("optional", "nonnull")),
autoLinkedKotlinLabsForeignSchema,
ForeignSchema("kotlin_labs", "v0.4", kotlinLabsDefinitions("v0.4"), listOf("optional")),
ForeignSchema("kotlin_labs", "v0.5", kotlinLabsDefinitions("v0.5"), listOf("optional")),
ForeignSchema("nullability", "v0.4", nullabilityDefinitions("v0.4"), listOf("catch")),
ForeignSchema("kotlin_compiler_options", "v0.0", definitionsFromString(compilerOptions_0_0), emptyList())
)
}

Expand Down Expand Up @@ -198,7 +204,10 @@ internal fun combineDefinitions(
check(builtInTypeDefinition is GQLNamed) {
"only extra named definitions are supported"
}
val existingDefinition = mergedDefinitions.firstOrNull { (it as? GQLNamed)?.name == builtInTypeDefinition.name }
val existingDefinition = mergedDefinitions.firstOrNull {
builtInTypeDefinition::class == it::class
&& (it as? GQLNamed)?.name == builtInTypeDefinition.name
}
if (existingDefinition == null) {
mergedDefinitions.add(builtInTypeDefinition)
}
Expand All @@ -208,7 +217,6 @@ internal fun combineDefinitions(
}



/**
* Outputs a schema document to SDL. For executable documents, use toUtf8()
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private inline fun <reified T, E> ExtensionsMerger.mergeTypedDefinition(
) where T : GQLDefinition, E : GQLTypeSystemExtension {
val index = newDefinitions.indexOfFirst { it is T }
if (index == -1) {
issues.add(OtherValidationIssue("Cannot find $extra definition to apply extension", extension.sourceLocation))
issues.add(OtherValidationIssue("Cannot find $extra definition to apply the following extension:\n${extension.toUtf8()}", extension.sourceLocation))
} else {
newDefinitions.set(index, merge(newDefinitions[index] as T))
}
Expand Down Expand Up @@ -188,7 +188,7 @@ private inline fun <reified T, E> ExtensionsMerger.mergeNamedDefinition(

when (indexedValues.size) {
0 -> {
issues.add(OtherValidationIssue("Cannot find $extra type `${extension.name}` to apply extension", extension.sourceLocation))
issues.add(OtherValidationIssue("Cannot find $extra type `${extension.name}` to apply the following extension:\n${extension.toUtf8()}", extension.sourceLocation))
}

1 -> {
Expand Down
Loading
Loading