Class ServiceSDLPrinter
java.lang.Object
com.apollographql.federation.graphqljava.printer.ServiceSDLPrinter
graphql.schema.idl.SchemaPrinter wrapper that is used to generate SDL returned by the
_service { sdl } query and is compatible with Federation v1 and v2 specs.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateServiceSDL(graphql.schema.GraphQLSchema schema, boolean queryTypeShouldBeEmpty) Deprecated.Migrate to use Federation v2static StringgenerateServiceSDLV2(graphql.schema.GraphQLSchema schema) Generate service SDL compatible with Federation v2 specification.
-
Method Details
-
generateServiceSDL
@Deprecated(since="05/16/2024") public static String generateServiceSDL(graphql.schema.GraphQLSchema schema, boolean queryTypeShouldBeEmpty) Deprecated.Migrate to use Federation v2Generate service SDL compatible with Federation v1 specification.- Parameters:
schema- target schemaqueryTypeShouldBeEmpty- boolean indicating whether query type contains "fake" query that should be removed (at least a single query has to be present for graphql-java to consider it as a valid schema)- Returns:
- SDL compatible with Federation v1
-
generateServiceSDLV2
Generate service SDL compatible with Federation v2 specification.- Parameters:
schema- target schema- Returns:
- SDL compatible with Federation v2
-