【问题标题】:How to disable async mode in graphql with 11.0.0如何使用 11.0.0 在 graphql 中禁用异步模式
【发布时间】:2021-05-20 05:07:05
【问题描述】:

graphql.servlet.asyncModeEnabled 在 8.0.0 版本之后从 GraphQLServletProperties.java 中删除。如何使用 11.0.0 禁用此功能?

【问题讨论】:

  • 我看了看,找不到任何东西。您可以尝试提供自己的执行策略:@Bean public Map executionStrategies() { Map executionStrategyMap = new HashMap(); executionStrategyMap.put("queryExecutionStrategy", new NotAsyncCustomExecutionStrategy());返回执行策略图; }
  • @AllirionX,即使我这样做,GraphQL ExecutionStragegy 也有一个方法public abstract CompletableFuture<ExecutionResult> execute(ExecutionContext executionContext, ExecutionStrategyParameters parameters) throws NonNullableFieldWasNullException;,我必须重写它。所以我不确定这是否会同步
  • 你是对的。我不确定是否有禁用异步的解决方案。为什么需要禁用它?
  • 因为我的日志框架需要同步请求

标签: asynchronous graphql graphql-java


【解决方案1】:

我提出了一个关于 graphql 的错误,他们正在使用 v11.1.0 再次引入该属性

https://github.com/graphql-java-kickstart/graphql-spring-boot/discussions/539

【讨论】:

    猜你喜欢
    • 2013-01-20
    • 2021-02-07
    • 2020-12-07
    • 2018-12-14
    • 2021-09-16
    • 2017-03-08
    • 2020-11-01
    • 2015-08-07
    • 2012-03-19
    相关资源
    最近更新 更多