@Override public void start(Stage primaryStage) throws IOException, URISyntaxException, QueryException { this.primaryStage = primaryStage; anchor = new AnchorPane(); VBox vbox = new VBox(locationBar(), anchor); primaryStage.setScene(new Scene(vbox, 800, 600)); Map<String, String> parameters = getParameters().getNamed(); application = new ObjectMapper(new YAMLFactory()) .readValue( Utils.resolveResource(getClass(), parameters.get("app")), GraphqlApplication.class); endpoint = ClientBuilder.newClient().target(application.getEndpoint().toURI()); push(new PageContext(application.getRoot())); primaryStage.show(); }
private PageContext extract(Route route, JsonNode item) { Map<String, Object> variables = new HashMap<>(); route .getExtract() .entrySet() .stream() .forEach( entry -> { variables.put(entry.getKey(), apply(item, entry.getValue())); }); Page target = application.route(route.getPath()); return new PageContext(target, variables); }