99designs / 99designs/gqlgen

Enum values are now checked in json.Unmarshal

オープン
#3,718 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
10.8k
フォーク
1.3k
平均マージ
2日 36分
マージ済み PR(30日)
26

説明

Checking enum values and returning an error if they are not valid during `json.Unmarshal` is a breaking change. Specifically, `json.Unmarshal` was not previously calling `e.UnmarshalGQL(s)`, which contains the additional check for valid enum values.

The commit: https://github.com/99designs/gqlgen/commit/eed4a10c6b0aa2ed65dc6282bdcbf255264ba624 (`plugin/modelgen/models.gotpl`)

I understand the GraphQL spec requires enums to always contain valid values, and gqlgen is technically released under a `0.x.x` semantic version, so breaking changes may be released at any time. We were unfortunately relying on the non-spec-compliant behavior in our application.

Could I add a config option to gqlgen that optionally disables the enum value checks?

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

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

評価

この issue はまだ評価されていません。

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

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