Skip to content

Commit cd1f354

Browse files
authored
Compatibility with Apollo 4.3 (#5)
* Compatibility with Apollo 4.3 * update apiDump
1 parent b2e6c14 commit cd1f354

File tree

13 files changed

+27
-385
lines changed

13 files changed

+27
-385
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
public final class com/apollographql/ffs/FfsCompilerPlugin : com/apollographql/apollo/compiler/ApolloCompilerPlugin {
22
public fun <init> ()V
3+
public fun beforeCompilationStep (Lcom/apollographql/apollo/compiler/ApolloCompilerPluginEnvironment;Lcom/apollographql/apollo/compiler/ApolloCompilerRegistry;)V
4+
public fun documentTransform ()Lcom/apollographql/apollo/compiler/DocumentTransform;
35
public fun foreignSchemas ()Ljava/util/List;
4-
}
5-
6-
public final class com/apollographql/ffs/FfsCompilerPluginProvider : com/apollographql/apollo/compiler/ApolloCompilerPluginProvider {
7-
public fun <init> ()V
8-
public fun create (Lcom/apollographql/apollo/compiler/ApolloCompilerPluginEnvironment;)Lcom/apollographql/apollo/compiler/ApolloCompilerPlugin;
6+
public fun irOperationsTransform ()Lcom/apollographql/apollo/compiler/Transform;
7+
public fun javaOutputTransform ()Lcom/apollographql/apollo/compiler/Transform;
8+
public fun kotlinOutputTransform ()Lcom/apollographql/apollo/compiler/Transform;
9+
public fun layout (Lcom/apollographql/apollo/compiler/CodegenSchema;)Lcom/apollographql/apollo/compiler/codegen/SchemaAndOperationsLayout;
10+
public fun operationIds (Ljava/util/List;)Ljava/util/List;
11+
public fun schemaListener ()Lcom/apollographql/apollo/compiler/SchemaListener;
912
}
1013

apollo-kotlin-ffs/src/main/kotlin/com/apollographql/ffs/FfsCompilerPlugin.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ import com.apollographql.apollo.ast.ForeignSchema
55
import com.apollographql.apollo.ast.toGQLDocument
66
import com.apollographql.apollo.compiler.ApolloCompilerPlugin
77
import com.apollographql.apollo.compiler.ApolloCompilerPluginEnvironment
8-
import com.apollographql.apollo.compiler.ApolloCompilerPluginProvider
8+
import com.apollographql.apollo.compiler.ApolloCompilerRegistry
99

1010
@ApolloExperimental
1111
class FfsCompilerPlugin: ApolloCompilerPlugin {
12-
override fun foreignSchemas(): List<ForeignSchema> {
12+
13+
override fun beforeCompilationStep(environment: ApolloCompilerPluginEnvironment, registry: ApolloCompilerRegistry) {
14+
registry.registerForeignSchemas(ffsSchemas())
15+
}
16+
17+
private fun ffsSchemas(): List<ForeignSchema> {
1318
val definitions = federationDefinitions_2_9.toGQLDocument().definitions
1419

1520
return listOf(
@@ -31,13 +36,6 @@ class FfsCompilerPlugin: ApolloCompilerPlugin {
3136
}
3237
}
3338

34-
@ApolloExperimental
35-
class FfsCompilerPluginProvider: ApolloCompilerPluginProvider {
36-
override fun create(environment: ApolloCompilerPluginEnvironment): ApolloCompilerPlugin {
37-
return FfsCompilerPlugin()
38-
}
39-
}
40-
4139
/**
4240
* Taken from https://www.apollographql.com/docs/graphos/reference/federation/subgraph-spec
4341
* with _Entity, _Any, _Service, Query._service and Query._entities removed.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.apollographql.ffs.FfsCompilerPlugin

apollo-kotlin-ffs/src/main/resources/META-INF/services/com.apollographql.apollo.compiler.ApolloCompilerPluginProvider

Lines changed: 0 additions & 1 deletion
This file was deleted.

ffs-test/gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gradle
-42.6 KB
Binary file not shown.

ffs-test/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 7 deletions
This file was deleted.

ffs-test/gradlew

Lines changed: 0 additions & 252 deletions
This file was deleted.

ffs-test/gradlew

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)