Compile-time error: "Argument field or value named 'order_by' can not be coerced"
还没有人认领这个 Issue。
评估
调研方向
使用查询和 schema 片段作为最小复现;首先跟踪 GraphQL 类型提供程序如何强制转换输入对象字段,尤其是枚举值的 order_by 和 distinct_on 字段。完成的标准是示例能够编译,并产生与手动运行的查询相同的结果,同时覆盖这些情况。
由索引模型根据 Issue 内容生成。
描述
Description
I am using Hasura, and trying to run the following query:
let operation = MyProvider.Operation<"""query q {
test_table (order_by: {some_name: asc}) {
id
some_name
}
}""">
The query is valid and works if run manually, but I get a compile-time error with the F# Type Provider:
error FS3033: The type provider 'FSharp.Data.GraphQL.Client.GraphQLTypeProvider'
reported an error:
Argument field or value named 'order_by' can not be coerced.
It does not match a valid literal representation for the type.
Path: ["q"; "test_table"]
The relevant part of the schema:
{
"inputFields": null,
"kind": "ENUM",
"possibleTypes": null,
"interfaces": null,
"name": "order_by",
"enumValues": [
{
"isDeprecated": false,
"deprecationReason": null,
"name": "asc",
"description": "in the ascending order, nulls last"
},
...
],
"description": "column ordering options",
"fields": null
}
I've tried other parameters, such as offset, limit, where (this one works now: https://github.com/fsprojects/FSharp.Data.GraphQL/issues/263), and they work. distinct_on, however, results in the same compile time error. Could this have something to do with the _ in the name?
Repro steps
See description.
Expected behavior
The application compiles, the query returns the same result as when run manually.
Actual behavior
Compile-time error.
Known workarounds
None.
Related information
- Mac OS X
- Version 1.0.3
- .NET Core 3.1
- 主要语言
- F#
- 星标
- 406
- 派生
- 74
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 14
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fsprojects/FSharp.Data.GraphQL 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 52/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
fsprojects/FSharp.Data.GraphQL#573 · 1 个 reaction · 已指派 2 人 ·
-
fsprojects/FSharp.Data.GraphQL#566 · 1 条评论 · 1 个 reaction · 已指派 2 人 ·
-
难度 5/5 一周以上 新手友好度 30/100
查看 fsprojects/FSharp.Data.GraphQL 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P2
难度 1/5 1 小时以内 新手友好度 80/100
-
难度 2/5 1-3 小时 新手友好度 75/100