小编Mil*_*jus的帖子

.Net 的 GraphQL 错误:未映射的选择字段

我只是在学习 .NET Core 和 GraphQL,无法从网络上获得一个示例(我已经尝试了十几个)来工作。他们都在使用这个库https://graphql-dotnet.github.io,每次我尝试使用有效的 GraphQL 查询访问端点时,我都会得到以下响应:

{
    "errors": [
        {
            "message": "Unmapped selection Field",
            "extensions": {
                "code": "EXECUTION_ERROR"
            }
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

示例之一:https : //github.com/mmacneil/ASPNetCoreGraphQL

我似乎找不到任何谷歌搜索该错误的内容,并且有关该错误的文档没有太多帮助。我希望有人与图书馆合作并遇到同样的问题。

这是在 GraphQLController 中执行查询的结果的错误:

InnerException = {GraphQL.ExecutionError: Unmapped selection Field 
at GraphQL.Language.CoreToVanillaConverter.Selection(ASTNode source)
at GraphQL.Language.CoreToVanillaConverter.SelectionSet(GraphQLSelectionSet source) 
at GraphQL.Language.CoreToVanillaConverter.Operation(GraphQLOperationDefinition source) 
at GraphQL.Language.CoreToVanillaConverter.AddDefinitions(GraphQLDocument source, Document target)
at GraphQL.Language.CoreToVanillaConverter.Convert(String body, GraphQLDocument source)
at GraphQL.Execution.GraphQLDocumentBuilder.Build(String body)
at GraphQL.DocumentExecuter.ExecuteAsync(ExecutionOptions options)
Run Code Online (Sandbox Code Playgroud)

这也是我在这里的第一篇文章。如果您需要更多信息,请告诉我。

c# graphql asp.net-core

5
推荐指数
1
解决办法
766
查看次数

标签 统计

asp.net-core ×1

c# ×1

graphql ×1