public SelectionSet transform(Consumer<Builder> builderConsumer) { Builder builder = new Builder(this); builderConsumer.accept(builder); return builder.build(); }
protected SelectionSet createSelectionSet(GraphqlParser.SelectionSetContext ctx) { if (ctx == null) { return null; } SelectionSet.Builder builder = SelectionSet.newSelectionSet(); addCommonData(builder, ctx); List<Selection> selections = ctx.selection().stream().map(selectionContext -> { if (selectionContext.field() != null) { return createField(selectionContext.field()); } if (selectionContext.fragmentSpread() != null) { return createFragmentSpread(selectionContext.fragmentSpread()); } if (selectionContext.inlineFragment() != null) { return createInlineFragment(selectionContext.inlineFragment()); } return (Selection) Assert.assertShouldNeverHappen(); }).collect(toList()); builder.selections(selections); return builder.build(); }
public SelectionSet transform(Consumer<Builder> builderConsumer) { Builder builder = new Builder(this); builderConsumer.accept(builder); return builder.build(); }
protected SelectionSet createSelectionSet(GraphqlParser.SelectionSetContext ctx) { if (ctx == null) { return null; } SelectionSet.Builder builder = SelectionSet.newSelectionSet(); addCommonData(builder, ctx); List<Selection> selections = ctx.selection().stream().map(selectionContext -> { if (selectionContext.field() != null) { return createField(selectionContext.field()); } if (selectionContext.fragmentSpread() != null) { return createFragmentSpread(selectionContext.fragmentSpread()); } if (selectionContext.inlineFragment() != null) { return createInlineFragment(selectionContext.inlineFragment()); } return (Selection) Assert.assertShouldNeverHappen(); }).collect(toList()); builder.selections(selections); return builder.build(); }