Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Compile-time error: "Argument field or value named 'order_by' can not be coerced"

オープン
#270 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
fsharp
領域
api, backend

調査の方向性

クエリとスキーマの抜粋を最小限の再現として使用し、まず GraphQL の型プロバイダーが入力オブジェクトのフィールド、特に enum 値を取る 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時間
マージ済み PR(30日)
14

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fsprojects/FSharp.Data.GraphQL のほかの issue

fsprojects/FSharp.Data.GraphQL の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。