-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6f249e
commit d071d45
Showing
8 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id("org.jetbrains.kotlin.jvm") | ||
id("com.apollographql.apollo3") | ||
} | ||
|
||
apolloTest() | ||
|
||
dependencies { | ||
implementation(libs.apollo.runtime) | ||
implementation(project(":multi-module-1-root")) | ||
testImplementation(libs.kotlin.test.junit) | ||
} | ||
|
||
apollo { | ||
service("service") { | ||
packageNamesFromFilePaths() | ||
dependsOn(project(":multi-module-1-root"), true) | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/multi-module-1/bidirectional/src/main/graphql/com/example/operations.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
query GetA { | ||
a { | ||
foo | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/multi-module-1/root/src/main/graphql/schema.graphqls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
type Query { | ||
long: Long! | ||
a: A | ||
b: B | ||
} | ||
|
||
type A { | ||
foo: Int | ||
} | ||
|
||
type B { | ||
foo: Int | ||
} | ||
|
||
scalar Long | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
import kotlin.test.Test | ||
|
||
class MainTest { | ||
@Test | ||
fun test() { | ||
println(multimodule1.root.fragment.QueryDetails::class.java) | ||
// A is used in the bidirectional module and registered automatically | ||
println(multimodule1.root.type.A::class.java) | ||
// B is not used at all and must not be generated | ||
try { | ||
val clazz = Class.forName("multimodule1.root.type.B") | ||
error("An exception was expected but got $clazz instead") | ||
} catch (e: ClassNotFoundException) { | ||
} | ||
} | ||
} |