Skip to content

Commit

Permalink
Fix FederationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
sachindshinde committed Mar 24, 2020
1 parent 20b2d3e commit 5860556
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,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.printWithoutStandardDirectiveDefinitions(federated));
"}\n" +
"\n" +
"scalar _FieldSet\n", SchemaUtils.printWithoutStandardDirectiveDefinitions(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 @@ -22,6 +22,7 @@ private SchemaUtils() {

static String printWithoutStandardDirectiveDefinitions(GraphQLSchema schema) {
return new FederationSdlPrinter(FederationSdlPrinter.Options.defaultOptions()
.includeScalarTypes(true)
.includeDirectives(directive -> !standardDirectives.contains(directive.getName()))
).print(schema);
}
Expand Down

0 comments on commit 5860556

Please sign in to comment.