Skip to content

Commit

Permalink
[IJ Plugin] Include subfolders when contributing GraphQL config (#5871)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD authored May 2, 2024
1 parent e7d70c5 commit 5ff2635
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApolloGraphQLConfigContributor : GraphQLConfigContributor {

private fun ApolloKotlinService.toGraphQLRawProjectConfig() = GraphQLRawProjectConfig(
schema = schemaPaths.map { GraphQLRawSchemaPointer(it) },
include = operationPaths.map { "$it/*.graphql" },
include = operationPaths.map { "$it/**/*.graphql" },
extensions = endpointUrl?.let {
mapOf(
GraphQLConfigKeys.EXTENSION_ENDPOINTS to mapOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GraphQLCustomUsageSearcherTest : ApolloTestCase() {

@Test
fun fragment() = testFindUsages(
fromFile = "src/main/graphql/ComputerFields.graphql",
fromFile = "src/main/graphql/fragments/ComputerFields.graphql",
moveCaret = { moveCaret("computerFields") },
expected = listOf(
"ComputersQuery.graphql" to "...computerFields",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class GraphQLGotoDeclarationHandlerTest : ApolloTestCase() {

@Test
fun goToFragmentClass() = testNavigation(
fromFile = "src/main/graphql/ComputerFields.graphql",
fromFile = "src/main/graphql/fragments/ComputerFields.graphql",
fromElement = { elementAt<PsiElement>("computerFields")!! },
toFile = "build/generated/source/apollo/main/com/example/generated/fragment/ComputerFields.kt",
toElement = { elementAt<KtClass>("class ComputerFields")!! },
Expand All @@ -77,7 +77,7 @@ class GraphQLGotoDeclarationHandlerTest : ApolloTestCase() {

@Test
fun goToField() = testNavigation(
fromFile = "src/main/graphql/ComputerFields.graphql",
fromFile = "src/main/graphql/fragments/ComputerFields.graphql",
fromElement = { elementAt<PsiElement>("resolution")!! },
toFile = "build/generated/source/apollo/main/com/example/generated/fragment/ComputerFields.kt",
toElement = { elementAt<KtParameter>("resolution")!! },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class KotlinGoToDeclarationHandlerTest : ApolloTestCase() {
fun goToFragmentDefinition() = testNavigation(
fromFile = "src/main/kotlin/com/example/Main.kt",
fromElement = { elementAt<PsiElement>("ComputerFields(") },
toFile = "src/main/graphql/ComputerFields.graphql",
toFile = "src/main/graphql/fragments/ComputerFields.graphql",
toElement = { elementAt<GraphQLFragmentDefinition>("fragment computerFields") }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class KotlinTypeDeclarationProviderTest : ApolloTestCase() {
fun goToFragmentDefinition() = testNavigation(
fromFile = "src/main/kotlin/com/example/Main.kt",
fromElement = { elementAt<KtProperty>("computerFields") },
toFile = "src/main/graphql/ComputerFields.graphql",
toFile = "src/main/graphql/fragments/ComputerFields.graphql",
toElement = { elementAt<GraphQLFragmentDefinition>("fragment computerFields") }
)

Expand Down

0 comments on commit 5ff2635

Please sign in to comment.