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
6 changes: 6 additions & 0 deletions libraries/apollo-ast/api/apollo-ast.api
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public final class com/apollographql/apollo/ast/ForeignSchema {
public final fun getVersion ()Ljava/lang/String;
}

public final class com/apollographql/apollo/ast/FragmentCycle : com/apollographql/apollo/ast/GraphQLValidationIssue {
public fun <init> (Ljava/lang/String;Lcom/apollographql/apollo/ast/SourceLocation;)V
public fun getMessage ()Ljava/lang/String;
public fun getSourceLocation ()Lcom/apollographql/apollo/ast/SourceLocation;
}

public final class com/apollographql/apollo/ast/GQLArgument : com/apollographql/apollo/ast/GQLNamed, com/apollographql/apollo/ast/GQLNode {
public fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Lcom/apollographql/apollo/ast/GQLValue;)V
public synthetic fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Lcom/apollographql/apollo/ast/GQLValue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down
9 changes: 9 additions & 0 deletions libraries/apollo-ast/api/apollo-ast.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ final class com.apollographql.apollo.ast/ForeignSchema { // com.apollographql.ap
final fun <get-version>(): kotlin/String // com.apollographql.apollo.ast/ForeignSchema.version.<get-version>|<get-version>(){}[0]
}

final class com.apollographql.apollo.ast/FragmentCycle : com.apollographql.apollo.ast/GraphQLValidationIssue { // com.apollographql.apollo.ast/FragmentCycle|null[0]
constructor <init>(kotlin/String, com.apollographql.apollo.ast/SourceLocation?) // com.apollographql.apollo.ast/FragmentCycle.<init>|<init>(kotlin.String;com.apollographql.apollo.ast.SourceLocation?){}[0]

final val message // com.apollographql.apollo.ast/FragmentCycle.message|{}message[0]
final fun <get-message>(): kotlin/String // com.apollographql.apollo.ast/FragmentCycle.message.<get-message>|<get-message>(){}[0]
final val sourceLocation // com.apollographql.apollo.ast/FragmentCycle.sourceLocation|{}sourceLocation[0]
final fun <get-sourceLocation>(): com.apollographql.apollo.ast/SourceLocation? // com.apollographql.apollo.ast/FragmentCycle.sourceLocation.<get-sourceLocation>|<get-sourceLocation>(){}[0]
}

final class com.apollographql.apollo.ast/GQLArgument : com.apollographql.apollo.ast/GQLNamed, com.apollographql.apollo.ast/GQLNode { // com.apollographql.apollo.ast/GQLArgument|null[0]
constructor <init>(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String, com.apollographql.apollo.ast/GQLValue) // com.apollographql.apollo.ast/GQLArgument.<init>|<init>(com.apollographql.apollo.ast.SourceLocation?;kotlin.String;com.apollographql.apollo.ast.GQLValue){}[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ class DifferentShape(override val message: String, override val sourceLocation:

class UnusedFragment(override val message: String, override val sourceLocation: SourceLocation?) : GraphQLValidationIssue

/**
* There is a fragment cycle.
*
* See https://spec.graphql.org/September2025/#sec-Fragment-Spreads-Must-Not-Form-Cycles
*/
class FragmentCycle(override val message: String, override val sourceLocation: SourceLocation?) : GraphQLValidationIssue

/**
* Two type definitions have the same name
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.apollographql.apollo.ast.Catch
import com.apollographql.apollo.ast.DeprecatedUsage
import com.apollographql.apollo.ast.DifferentShape
import com.apollographql.apollo.ast.ExecutableValidationResult
import com.apollographql.apollo.ast.FragmentCycle
import com.apollographql.apollo.ast.GQLArgument
import com.apollographql.apollo.ast.GQLBooleanValue
import com.apollographql.apollo.ast.GQLDirective
Expand Down Expand Up @@ -117,7 +118,7 @@ internal class ExecutableValidationScope(
val index = path.indexOf("__${name}")
val nextPath = path + "__${fragment.name}"
if (index != -1) {
registerIssue("Fragment '$name' spreads itself, creating a cycle at '${nextPath.subList(index, nextPath.size).joinToString(".")}'", it.sourceLocation)
issues.add(FragmentCycle("Fragment '$name' spreads itself, creating a cycle at '${nextPath.subList(index, nextPath.size).joinToString(".")}'", it.sourceLocation))
cyclicFragments.add(name)
return@forEach
}
Expand Down

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

Loading