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
22 changes: 4 additions & 18 deletions multi-modules-and-services/feature1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,15 @@ apollo {
srcDir("src/main/graphql/servicea")
packageName.set("com.example.servicea")

/*
* Depend on the schema and fragments from service "service-a" in module "graphqlShared".
*
* The `bidirectional` parameter allows to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
dependsOn(project(":graphqlShared"), bidirectional = true)
// Depend on the schema and fragments from service "service-a" in module "graphqlShared".
dependsOn(project(":graphqlShared"))
}

service("service-b") {
srcDir("src/main/graphql/serviceb")
packageName.set("com.example.serviceb")

/*
* Depend on the schema and fragments from service "service-b" in module "graphqlShared".
*
* The `bidirectional` parameter allows to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
dependsOn(project(":graphqlShared"), bidirectional = true)
// Depend on the schema and fragments from service "service-b" in module "graphqlShared".
dependsOn(project(":graphqlShared"))
}
}
22 changes: 4 additions & 18 deletions multi-modules-and-services/feature2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,15 @@ apollo {
srcDir("src/main/graphql/servicea")
packageName.set("com.example.servicea")

/*
* Depend on the schema and fragments from service "service-a" in module "graphqlShared".
*
* The `bidirectional` parameter allows to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
dependsOn(project(":graphqlShared"), bidirectional = true)
// Depend on the schema and fragments from service "service-a" in module "graphqlShared".
dependsOn(project(":graphqlShared"))
}

service("service-b") {
srcDir("src/main/graphql/serviceb")
packageName.set("com.example.serviceb")

/*
* Depend on the schema and fragments from service "service-b" in module "graphqlShared".
*
* The `bidirectional` parameter allows to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
dependsOn(project(":graphqlShared"), bidirectional = true)
// Depend on the schema and fragments from service "service-b" in module "graphqlShared".
dependsOn(project(":graphqlShared"))
}
}
16 changes: 16 additions & 0 deletions multi-modules-and-services/graphqlSchema/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ apollo {
endpointUrl.set("https://schema-servicea.com")
schemaFile.set(file("src/main/graphql/servicea/schema.graphqls"))
}

/*
* Enable the bidirectional dependency which allows to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
isADependencyOf(project(":graphqlShared"))
}

service("service-b") {
Expand All @@ -31,5 +39,13 @@ apollo {
endpointUrl.set("https://schema-serviceb.com")
schemaFile.set(file("src/main/graphql/serviceb/schema.graphqls"))
}

/*
* Enable the bidirectional dependency which allows to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
isADependencyOf(project(":graphqlShared"))
}
}
20 changes: 12 additions & 8 deletions multi-modules-and-services/graphqlShared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,33 @@ apollo {
srcDir("src/main/graphql/servicea")
packageName.set("com.example.servicea")

// Depend on the schema from service "service-a" in module "graphqlSchema".
dependsOn(project(":graphqlSchema"))

/*
* Depend on the schema from service "service-a" in module "graphqlSchema".
*
* The `bidirectional` parameter allows to reduce the size of the generated code by telling
* Enable the bidirectional dependencies which allow to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
dependsOn(project(":graphqlSchema"), bidirectional = true)
isADependencyOf(project(":feature1"))
isADependencyOf(project(":feature2"))
}

service("service-b") {
srcDir("src/main/graphql/serviceb")
packageName.set("com.example.serviceb")

// Depend on the schema from service "service-b" in module "graphqlSchema".
dependsOn(project(":graphqlSchema"))

/*
* Depend on the schema from service "service-b" in module "graphqlSchema".
*
* The `bidirectional` parameter allows to reduce the size of the generated code by telling
* Enable the bidirectional dependencies which allow to reduce the size of the generated code by telling
* upstream modules to only generate the used types.
*
* See https://www.apollographql.com/docs/kotlin/advanced/multi-modules/#auto-detection-of-used-types
*/
dependsOn(project(":graphqlSchema"), bidirectional = true)
isADependencyOf(project(":feature1"))
isADependencyOf(project(":feature2"))
}
}