Skip to content
Draft
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
23 changes: 21 additions & 2 deletions libraries/apollo-ast/api/apollo-ast.api
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,21 @@ public final class com/apollographql/apollo/ast/GQLDirectiveCoordinate : com/apo
public fun writeInternal (Lcom/apollographql/apollo/ast/SDLWriter;)V
}

public final class com/apollographql/apollo/ast/GQLDirectiveDefinition : com/apollographql/apollo/ast/GQLDefinition, com/apollographql/apollo/ast/GQLDescribed, com/apollographql/apollo/ast/GQLNamed {
public final class com/apollographql/apollo/ast/GQLDirectiveDefinition : com/apollographql/apollo/ast/GQLDefinition, com/apollographql/apollo/ast/GQLDescribed, com/apollographql/apollo/ast/GQLHasDirectives, com/apollographql/apollo/ast/GQLNamed {
public static final field Companion Lcom/apollographql/apollo/ast/GQLDirectiveDefinition$Companion;
public fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;)V
public synthetic fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun copy (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;)Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;
public fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;Ljava/util/List;)V
public synthetic fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final synthetic fun copy (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;)Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;
public final fun copy (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;Ljava/util/List;)Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;
public static synthetic fun copy$default (Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;ILjava/lang/Object;)Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;
public static synthetic fun copy$default (Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLjava/util/List;Ljava/util/List;ILjava/lang/Object;)Lcom/apollographql/apollo/ast/GQLDirectiveDefinition;
public fun copyWithNewChildrenInternal (Lcom/apollographql/apollo/ast/NodeContainer;)Lcom/apollographql/apollo/ast/GQLNode;
public final fun getArguments ()Ljava/util/List;
public fun getChildren ()Ljava/util/List;
public fun getDescription ()Ljava/lang/String;
public fun getDirectives ()Ljava/util/List;
public final fun getLocations ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public final fun getRepeatable ()Z
Expand All @@ -253,8 +258,22 @@ public final class com/apollographql/apollo/ast/GQLDirectiveDefinition$Companion
public final fun getBuiltInDirectives ()Ljava/util/Set;
}

public final class com/apollographql/apollo/ast/GQLDirectiveExtension : com/apollographql/apollo/ast/GQLDefinition, com/apollographql/apollo/ast/GQLHasDirectives, com/apollographql/apollo/ast/GQLNamed, com/apollographql/apollo/ast/GQLTypeSystemExtension {
public fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/util/List;)V
public synthetic fun <init> (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun copy (Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/util/List;)Lcom/apollographql/apollo/ast/GQLDirectiveExtension;
public static synthetic fun copy$default (Lcom/apollographql/apollo/ast/GQLDirectiveExtension;Lcom/apollographql/apollo/ast/SourceLocation;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Lcom/apollographql/apollo/ast/GQLDirectiveExtension;
public fun copyWithNewChildrenInternal (Lcom/apollographql/apollo/ast/NodeContainer;)Lcom/apollographql/apollo/ast/GQLNode;
public fun getChildren ()Ljava/util/List;
public fun getDirectives ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
public fun getSourceLocation ()Lcom/apollographql/apollo/ast/SourceLocation;
public fun writeInternal (Lcom/apollographql/apollo/ast/SDLWriter;)V
}

public final class com/apollographql/apollo/ast/GQLDirectiveLocation : java/lang/Enum {
public static final field ARGUMENT_DEFINITION Lcom/apollographql/apollo/ast/GQLDirectiveLocation;
public static final field DIRECTIVE_DEFINITION Lcom/apollographql/apollo/ast/GQLDirectiveLocation;
public static final field ENUM Lcom/apollographql/apollo/ast/GQLDirectiveLocation;
public static final field ENUM_VALUE Lcom/apollographql/apollo/ast/GQLDirectiveLocation;
public static final field FIELD Lcom/apollographql/apollo/ast/GQLDirectiveLocation;
Expand Down
24 changes: 23 additions & 1 deletion libraries/apollo-ast/api/apollo-ast.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ final enum class com.apollographql.apollo.ast/CatchTo : kotlin/Enum<com.apollogr

final enum class com.apollographql.apollo.ast/GQLDirectiveLocation : kotlin/Enum<com.apollographql.apollo.ast/GQLDirectiveLocation> { // com.apollographql.apollo.ast/GQLDirectiveLocation|null[0]
enum entry ARGUMENT_DEFINITION // com.apollographql.apollo.ast/GQLDirectiveLocation.ARGUMENT_DEFINITION|null[0]
enum entry DIRECTIVE_DEFINITION // com.apollographql.apollo.ast/GQLDirectiveLocation.DIRECTIVE_DEFINITION|null[0]
enum entry ENUM // com.apollographql.apollo.ast/GQLDirectiveLocation.ENUM|null[0]
enum entry ENUM_VALUE // com.apollographql.apollo.ast/GQLDirectiveLocation.ENUM_VALUE|null[0]
enum entry FIELD // com.apollographql.apollo.ast/GQLDirectiveLocation.FIELD|null[0]
Expand Down Expand Up @@ -362,15 +363,18 @@ final class com.apollographql.apollo.ast/GQLDirectiveCoordinate : com.apollograp
final fun writeInternal(com.apollographql.apollo.ast/SDLWriter) // com.apollographql.apollo.ast/GQLDirectiveCoordinate.writeInternal|writeInternal(com.apollographql.apollo.ast.SDLWriter){}[0]
}

final class com.apollographql.apollo.ast/GQLDirectiveDefinition : com.apollographql.apollo.ast/GQLDefinition, com.apollographql.apollo.ast/GQLDescribed, com.apollographql.apollo.ast/GQLNamed { // com.apollographql.apollo.ast/GQLDirectiveDefinition|null[0]
final class com.apollographql.apollo.ast/GQLDirectiveDefinition : com.apollographql.apollo.ast/GQLDefinition, com.apollographql.apollo.ast/GQLDescribed, com.apollographql.apollo.ast/GQLHasDirectives, com.apollographql.apollo.ast/GQLNamed { // com.apollographql.apollo.ast/GQLDirectiveDefinition|null[0]
constructor <init>(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String?, kotlin/String, kotlin.collections/List<com.apollographql.apollo.ast/GQLInputValueDefinition>, kotlin/Boolean, kotlin.collections/List<com.apollographql.apollo.ast/GQLDirectiveLocation>) // com.apollographql.apollo.ast/GQLDirectiveDefinition.<init>|<init>(com.apollographql.apollo.ast.SourceLocation?;kotlin.String?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLInputValueDefinition>;kotlin.Boolean;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirectiveLocation>){}[0]
constructor <init>(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String?, kotlin/String, kotlin.collections/List<com.apollographql.apollo.ast/GQLInputValueDefinition>, kotlin/Boolean, kotlin.collections/List<com.apollographql.apollo.ast/GQLDirectiveLocation>, kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective>) // com.apollographql.apollo.ast/GQLDirectiveDefinition.<init>|<init>(com.apollographql.apollo.ast.SourceLocation?;kotlin.String?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLInputValueDefinition>;kotlin.Boolean;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirectiveLocation>;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirective>){}[0]

final val arguments // com.apollographql.apollo.ast/GQLDirectiveDefinition.arguments|{}arguments[0]
final fun <get-arguments>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLInputValueDefinition> // com.apollographql.apollo.ast/GQLDirectiveDefinition.arguments.<get-arguments>|<get-arguments>(){}[0]
final val children // com.apollographql.apollo.ast/GQLDirectiveDefinition.children|{}children[0]
final fun <get-children>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLNode> // com.apollographql.apollo.ast/GQLDirectiveDefinition.children.<get-children>|<get-children>(){}[0]
final val description // com.apollographql.apollo.ast/GQLDirectiveDefinition.description|{}description[0]
final fun <get-description>(): kotlin/String? // com.apollographql.apollo.ast/GQLDirectiveDefinition.description.<get-description>|<get-description>(){}[0]
final val directives // com.apollographql.apollo.ast/GQLDirectiveDefinition.directives|{}directives[0]
final fun <get-directives>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective> // com.apollographql.apollo.ast/GQLDirectiveDefinition.directives.<get-directives>|<get-directives>(){}[0]
final val locations // com.apollographql.apollo.ast/GQLDirectiveDefinition.locations|{}locations[0]
final fun <get-locations>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLDirectiveLocation> // com.apollographql.apollo.ast/GQLDirectiveDefinition.locations.<get-locations>|<get-locations>(){}[0]
final val name // com.apollographql.apollo.ast/GQLDirectiveDefinition.name|{}name[0]
Expand All @@ -381,6 +385,7 @@ final class com.apollographql.apollo.ast/GQLDirectiveDefinition : com.apollograp
final fun <get-sourceLocation>(): com.apollographql.apollo.ast/SourceLocation? // com.apollographql.apollo.ast/GQLDirectiveDefinition.sourceLocation.<get-sourceLocation>|<get-sourceLocation>(){}[0]

final fun copy(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String? = ..., kotlin/String = ..., kotlin.collections/List<com.apollographql.apollo.ast/GQLInputValueDefinition> = ..., kotlin/Boolean = ..., kotlin.collections/List<com.apollographql.apollo.ast/GQLDirectiveLocation> = ...): com.apollographql.apollo.ast/GQLDirectiveDefinition // com.apollographql.apollo.ast/GQLDirectiveDefinition.copy|copy(com.apollographql.apollo.ast.SourceLocation?;kotlin.String?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLInputValueDefinition>;kotlin.Boolean;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirectiveLocation>){}[0]
final fun copy(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String? = ..., kotlin/String = ..., kotlin.collections/List<com.apollographql.apollo.ast/GQLInputValueDefinition> = ..., kotlin/Boolean = ..., kotlin.collections/List<com.apollographql.apollo.ast/GQLDirectiveLocation> = ..., kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective> = ...): com.apollographql.apollo.ast/GQLDirectiveDefinition // com.apollographql.apollo.ast/GQLDirectiveDefinition.copy|copy(com.apollographql.apollo.ast.SourceLocation?;kotlin.String?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLInputValueDefinition>;kotlin.Boolean;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirectiveLocation>;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirective>){}[0]
final fun copyWithNewChildrenInternal(com.apollographql.apollo.ast/NodeContainer): com.apollographql.apollo.ast/GQLNode // com.apollographql.apollo.ast/GQLDirectiveDefinition.copyWithNewChildrenInternal|copyWithNewChildrenInternal(com.apollographql.apollo.ast.NodeContainer){}[0]
final fun isBuiltIn(): kotlin/Boolean // com.apollographql.apollo.ast/GQLDirectiveDefinition.isBuiltIn|isBuiltIn(){}[0]
final fun writeInternal(com.apollographql.apollo.ast/SDLWriter) // com.apollographql.apollo.ast/GQLDirectiveDefinition.writeInternal|writeInternal(com.apollographql.apollo.ast.SDLWriter){}[0]
Expand All @@ -391,6 +396,23 @@ final class com.apollographql.apollo.ast/GQLDirectiveDefinition : com.apollograp
}
}

final class com.apollographql.apollo.ast/GQLDirectiveExtension : com.apollographql.apollo.ast/GQLDefinition, com.apollographql.apollo.ast/GQLHasDirectives, com.apollographql.apollo.ast/GQLNamed, com.apollographql.apollo.ast/GQLTypeSystemExtension { // com.apollographql.apollo.ast/GQLDirectiveExtension|null[0]
constructor <init>(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String, kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective>) // com.apollographql.apollo.ast/GQLDirectiveExtension.<init>|<init>(com.apollographql.apollo.ast.SourceLocation?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirective>){}[0]

final val children // com.apollographql.apollo.ast/GQLDirectiveExtension.children|{}children[0]
final fun <get-children>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLNode> // com.apollographql.apollo.ast/GQLDirectiveExtension.children.<get-children>|<get-children>(){}[0]
final val directives // com.apollographql.apollo.ast/GQLDirectiveExtension.directives|{}directives[0]
final fun <get-directives>(): kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective> // com.apollographql.apollo.ast/GQLDirectiveExtension.directives.<get-directives>|<get-directives>(){}[0]
final val name // com.apollographql.apollo.ast/GQLDirectiveExtension.name|{}name[0]
final fun <get-name>(): kotlin/String // com.apollographql.apollo.ast/GQLDirectiveExtension.name.<get-name>|<get-name>(){}[0]
final val sourceLocation // com.apollographql.apollo.ast/GQLDirectiveExtension.sourceLocation|{}sourceLocation[0]
final fun <get-sourceLocation>(): com.apollographql.apollo.ast/SourceLocation? // com.apollographql.apollo.ast/GQLDirectiveExtension.sourceLocation.<get-sourceLocation>|<get-sourceLocation>(){}[0]

final fun copy(com.apollographql.apollo.ast/SourceLocation? = ..., kotlin/String = ..., kotlin.collections/List<com.apollographql.apollo.ast/GQLDirective> = ...): com.apollographql.apollo.ast/GQLDirectiveExtension // com.apollographql.apollo.ast/GQLDirectiveExtension.copy|copy(com.apollographql.apollo.ast.SourceLocation?;kotlin.String;kotlin.collections.List<com.apollographql.apollo.ast.GQLDirective>){}[0]
final fun copyWithNewChildrenInternal(com.apollographql.apollo.ast/NodeContainer): com.apollographql.apollo.ast/GQLNode // com.apollographql.apollo.ast/GQLDirectiveExtension.copyWithNewChildrenInternal|copyWithNewChildrenInternal(com.apollographql.apollo.ast.NodeContainer){}[0]
final fun writeInternal(com.apollographql.apollo.ast/SDLWriter) // com.apollographql.apollo.ast/GQLDirectiveExtension.writeInternal|writeInternal(com.apollographql.apollo.ast.SDLWriter){}[0]
}

final class com.apollographql.apollo.ast/GQLDocument : com.apollographql.apollo.ast/GQLNode { // com.apollographql.apollo.ast/GQLDocument|null[0]
constructor <init>(kotlin.collections/List<com.apollographql.apollo.ast/GQLDefinition>, com.apollographql.apollo.ast/SourceLocation?) // com.apollographql.apollo.ast/GQLDocument.<init>|<init>(kotlin.collections.List<com.apollographql.apollo.ast.GQLDefinition>;com.apollographql.apollo.ast.SourceLocation?){}[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,23 +678,46 @@ class GQLDirectiveDefinition(
val arguments: List<GQLInputValueDefinition>,
val repeatable: Boolean,
val locations: List<GQLDirectiveLocation>,
) : GQLDefinition, GQLDescribed, GQLNamed {
override val directives: List<GQLDirective>,
) : GQLDefinition, GQLDescribed, GQLNamed, GQLHasDirectives {

@Deprecated("Use the other constructor")
@ApolloDeprecatedSince(ApolloDeprecatedSince.Version.v5_0_0)
constructor(
sourceLocation: SourceLocation? = null,
description: String?,
name: String,
arguments: List<GQLInputValueDefinition>,
repeatable: Boolean,
locations: List<GQLDirectiveLocation>,
) : this(
sourceLocation = sourceLocation,
description = description,
name = name,
arguments = arguments,
repeatable = repeatable,
locations = locations,
directives = emptyList(),
)

override val children: List<GQLNode> = arguments

override fun writeInternal(writer: SDLWriter) {
with(writer) {
writeDescription(description)
write("directive @$name")
if (arguments.isNotEmpty()) {
write(" ")
arguments.join(writer, prefix = "(", separator = ", ", postfix = ")") {
it.write(writer, true)
}
}
if (directives.isNotEmpty()) {
directives.join(writer, prefix = " ")
}
if (repeatable) {
write(" repeatable")
}
write(" on ${locations.joinToString("|")}")
write(" on ${locations.joinToString(" | ")}")
write("\n")
}
}
Expand All @@ -706,13 +729,34 @@ class GQLDirectiveDefinition(
arguments: List<GQLInputValueDefinition> = this.arguments,
repeatable: Boolean = this.repeatable,
locations: List<GQLDirectiveLocation> = this.locations,
directives: List<GQLDirective> = this.directives,
): GQLDirectiveDefinition = GQLDirectiveDefinition(
sourceLocation = sourceLocation,
description = description,
name = name,
arguments = arguments,
repeatable = repeatable,
locations = locations,
directives = directives,
)

@Deprecated("Kept for binary compatibility", level = DeprecationLevel.HIDDEN)
@ApolloDeprecatedSince(ApolloDeprecatedSince.Version.v5_0_0)
fun copy(
sourceLocation: SourceLocation? = this.sourceLocation,
description: String? = this.description,
name: String = this.name,
arguments: List<GQLInputValueDefinition> = this.arguments,
repeatable: Boolean = this.repeatable,
locations: List<GQLDirectiveLocation> = this.locations,
): GQLDirectiveDefinition = GQLDirectiveDefinition(
sourceLocation = sourceLocation,
description = description,
name = name,
arguments = arguments,
repeatable = repeatable,
locations = locations,
directives = this.directives,
)

override fun copyWithNewChildrenInternal(container: NodeContainer): GQLNode {
Expand Down Expand Up @@ -1055,6 +1099,40 @@ class GQLUnionTypeExtension(
}
}

class GQLDirectiveExtension(
override val sourceLocation: SourceLocation? = null,
override val name: String,
override val directives: List<GQLDirective>,
) : GQLDefinition, GQLTypeSystemExtension, GQLNamed, GQLHasDirectives {

override val children: List<GQLNode> = directives

override fun writeInternal(writer: SDLWriter) {
with(writer) {
write("extend directive @$name")
if (directives.isNotEmpty()) {
directives.join(writer, prefix = " ")
}
}
}

fun copy(
sourceLocation: SourceLocation? = this.sourceLocation,
name: String = this.name,
directives: List<GQLDirective> = this.directives,
): GQLDirectiveExtension = GQLDirectiveExtension(
sourceLocation = sourceLocation,
name = name,
directives = directives,
)

override fun copyWithNewChildrenInternal(container: NodeContainer): GQLNode {
return copy(
directives = container.take()
)
}
}

class GQLEnumValueDefinition(
override val sourceLocation: SourceLocation? = null,
override val description: String?,
Expand Down Expand Up @@ -2059,6 +2137,7 @@ enum class GQLDirectiveLocation {
ENUM_VALUE,
INPUT_OBJECT,
INPUT_FIELD_DEFINITION,
DIRECTIVE_DEFINITION,
}

sealed interface GQLSchemaCoordinate
Expand Down
Loading
Loading