Skip to content

Commit

Permalink
Fix FederationTest and SchemaUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
sachindshinde committed Mar 26, 2020
1 parent 03c0482 commit 39c3136
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,25 @@ class FederationTest {
void testEmpty() {
final GraphQLSchema federated = Federation.transform(emptySDL)
.build();
Assertions.assertEquals("type Query {\n" +
Assertions.assertEquals("directive @extends on OBJECT\n" +
"\n" +
"directive @external on FIELD_DEFINITION\n" +
"\n" +
"directive @key(fields: _FieldSet!) on OBJECT | INTERFACE\n" +
"\n" +
"directive @provides(fields: _FieldSet!) on FIELD_DEFINITION\n" +
"\n" +
"directive @requires(fields: _FieldSet!) on FIELD_DEFINITION\n" +
"\n" +
"type Query {\n" +
" _service: _Service\n" +
"}\n" +
"\n" +
"type _Service {\n" +
" sdl: String!\n" +
"}\n", SchemaUtils.printSchema(federated));
"}\n" +
"\n" +
"scalar _FieldSet\n", SchemaUtils.printSchema(federated));

final GraphQLType _Service = federated.getType("_Service");
assertNotNull(_Service, "_Service type present");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ private SchemaUtils() {
}

static String printSchema(GraphQLSchema schema) {
return new FederationSdlPrinter().print(schema);
return new FederationSdlPrinter(FederationSdlPrinter.Options.defaultOptions()
.includeScalarTypes(true)
).print(schema);
}

static ExecutionResult execute(GraphQLSchema schema, String query) {
Expand Down

0 comments on commit 39c3136

Please sign in to comment.