@Test void testSimpleService() { final GraphQLSchema federated = Federation.transform(productSDL) .fetchEntities(env -> env.<List<Map<String, Object>>>getArgument(_Entity.argumentName) .stream() .map(map -> { if ("Product".equals(map.get("__typename"))) { return Product.PLANCK; } return null; }) .collect(Collectors.toList())) .resolveEntityType(env -> env.getSchema().getObjectType("Product")) .build(); SchemaUtils.assertSDL(federated, productSDL); final ExecutionResult result = SchemaUtils.execute(federated, "{\n" + " _entities(representations: [{__typename:\"Product\"}]) {\n" + " ... on Product { price }\n" + " }" + "}"); assertEquals(0, result.getErrors().size(), "No errors"); final Map<String, Object> data = result.getData(); @SuppressWarnings("unchecked") final List<Map<String, Object>> _entities = (List<Map<String, Object>>) data.get("_entities"); assertEquals(1, _entities.size()); assertEquals(180, _entities.get(0).get("price")); }
@NotNull public static SchemaTransformer transform(final GraphQLSchema schema) { return new SchemaTransformer(schema); }
Federation { @NotNull public static SchemaTransformer transform(final GraphQLSchema schema) { return new SchemaTransformer(schema); } }
Federation { @NotNull public static SchemaTransformer transform(final GraphQLSchema schema) { return new SchemaTransformer(schema); } private  Federation(); }
Federation { @NotNull public static SchemaTransformer transform(final GraphQLSchema schema) { return new SchemaTransformer(schema); } private  Federation(); @NotNull static SchemaTransformer transform(final GraphQLSchema schema); static SchemaTransformer transform(final TypeDefinitionRegistry typeRegistry, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final TypeDefinitionRegistry typeRegistry); static SchemaTransformer transform(final String sdl, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final Reader sdl, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final File sdl, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final String sdl); static SchemaTransformer transform(final Reader sdl); static SchemaTransformer transform(final File sdl); }
Federation { @NotNull public static SchemaTransformer transform(final GraphQLSchema schema) { return new SchemaTransformer(schema); } private  Federation(); @NotNull static SchemaTransformer transform(final GraphQLSchema schema); static SchemaTransformer transform(final TypeDefinitionRegistry typeRegistry, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final TypeDefinitionRegistry typeRegistry); static SchemaTransformer transform(final String sdl, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final Reader sdl, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final File sdl, final RuntimeWiring runtimeWiring); static SchemaTransformer transform(final String sdl); static SchemaTransformer transform(final Reader sdl); static SchemaTransformer transform(final File sdl);  }