graphql.GraphQL.nvl()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中graphql.GraphQL.nvl()方法的一些代码示例,展示了GraphQL.nvl()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GraphQL.nvl()方法的具体详情如下:
包路径:graphql.GraphQL
类名称:GraphQL
方法名:nvl

GraphQL.nvl介绍

暂无

代码示例

代码示例来源:origin: graphql-java/graphql-java

/**
 * This helps you transform the current GraphQL object into another one by starting a builder with all
 * the current values and allows you to transform it how you want.
 *
 * @param builderConsumer the consumer code that will be given a builder to transform
 *
 * @return a new GraphQL object based on calling build on that builder
 */
public GraphQL transform(Consumer<GraphQL.Builder> builderConsumer) {
  Builder builder = new Builder(this.graphQLSchema);
  builder
      .queryExecutionStrategy(nvl(this.queryStrategy, builder.queryExecutionStrategy))
      .mutationExecutionStrategy(nvl(this.mutationStrategy, builder.mutationExecutionStrategy))
      .subscriptionExecutionStrategy(nvl(this.subscriptionStrategy, builder.subscriptionExecutionStrategy))
      .executionIdProvider(nvl(this.idProvider, builder.idProvider))
      .instrumentation(nvl(this.instrumentation, builder.instrumentation))
      .preparsedDocumentProvider(nvl(this.preparsedDocumentProvider, builder.preparsedDocumentProvider));
  builderConsumer.accept(builder);
  return builder.build();
}

代码示例来源:origin: com.graphql-java/graphql-java

/**
 * This helps you transform the current GraphQL object into another one by starting a builder with all
 * the current values and allows you to transform it how you want.
 *
 * @param builderConsumer the consumer code that will be given a builder to transform
 *
 * @return a new GraphQL object based on calling build on that builder
 */
public GraphQL transform(Consumer<GraphQL.Builder> builderConsumer) {
  Builder builder = new Builder(this.graphQLSchema);
  builder
      .queryExecutionStrategy(nvl(this.queryStrategy, builder.queryExecutionStrategy))
      .mutationExecutionStrategy(nvl(this.mutationStrategy, builder.mutationExecutionStrategy))
      .subscriptionExecutionStrategy(nvl(this.subscriptionStrategy, builder.subscriptionExecutionStrategy))
      .executionIdProvider(nvl(this.idProvider, builder.idProvider))
      .instrumentation(nvl(this.instrumentation, builder.instrumentation))
      .preparsedDocumentProvider(nvl(this.preparsedDocumentProvider, builder.preparsedDocumentProvider));
  builderConsumer.accept(builder);
  return builder.build();
}

相关文章