You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[federation] fix: SDL should be generated for non-federated schemas (#417)
Federated GraphQL gateway can contain number of services that are not exposing any of their types as federated types (i.e. without exposing any of them using @key directives). We were incorrectly generating SDL only if there were some federated types in the generated schema. Fix is to always generated the SDL.
Copy file name to clipboardExpand all lines: graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/federation/FederatedSchemaGeneratorHooks.kt
+19-19Lines changed: 19 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,25 @@ open class FederatedSchemaGeneratorHooks(private val federatedTypeRegistry: Fede
69
69
.field(SERVICE_FIELD_DEFINITION)
70
70
.withDirective(extendsDirectiveType)
71
71
72
+
/**
73
+
* SDL returned by _service query should NOT contain
74
+
* - default schema definition
75
+
* - empty Query type
76
+
* - any directive definitions
77
+
* - any custom directives
78
+
* - new federated scalars
79
+
*/
80
+
val sdl = originalSchema.print(includeDefaultSchemaDefinition =false)
81
+
/**
82
+
* TODO: this can be simplified once this is solved: apollographql/apollo-server#3334
Copy file name to clipboardExpand all lines: graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/federation/execution/ServiceQueryResolverTest.kt
0 commit comments