【问题标题】:How to convert AST to GraphQL如何将 AST 转换为 GraphQL
【发布时间】:2021-11-28 23:15:00
【问题描述】:

我们需要重命名graphQL中的字段,所以我们先得到GraphQL的AST,然后根据需要进行修改。 但是,我找不到将 AST 转换回 GraphQL 的任何解决方案。

我使用的解析器是“GraphQL Dotnet Parser"

【问题讨论】:

    标签: graphql-tools graphql-dotnet


    【解决方案1】:

    有一个AstPrinter 类可以打印出Document 或任何Ast 节点。

    https://github.com/graphql-dotnet/graphql-dotnet/blob/master/src/GraphQL/Utilities/AstPrinter.cs

    AstPrinter.Print(…)

    【讨论】:

      猜你喜欢
      • 2014-08-30
      • 2018-12-28
      • 2020-12-08
      • 2013-11-27
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-23
      相关资源
      最近更新 更多