From ff6b20bc013a314d4ee42913c083a71dddd7cfe3 Mon Sep 17 00:00:00 2001 From: Dor Liberman Date: Mon, 9 May 2022 19:30:51 +0300 Subject: [PATCH 1/3] doc/md: fixing NamedValues option in Add Fields To The Schema example --- doc/md/tutorial-todo-crud.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/md/tutorial-todo-crud.md b/doc/md/tutorial-todo-crud.md index e5d9f713c8..e4fbad2919 100755 --- a/doc/md/tutorial-todo-crud.md +++ b/doc/md/tutorial-todo-crud.md @@ -39,12 +39,19 @@ func (Todo) Fields() []ent.Field { Default(time.Now). Immutable(), field.Enum("status"). - Values("in_progress", "completed"). + NamedValues( + "InProgress", "IN_PROGRESS", + "Completed", "COMPLETED", + ). + Annotations( + entgql.OrderField("STATUS") + ), Default("in_progress"), field.Int("priority"). Default(0), } } + ``` After adding these fields, we need to run the code-generation as before: From 246fd2c32e14d9c268a50f27f0c54c1f796ed059 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Sun, 12 Jun 2022 12:11:31 +0300 Subject: [PATCH 2/3] Update doc/md/tutorial-todo-crud.md --- doc/md/tutorial-todo-crud.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/md/tutorial-todo-crud.md b/doc/md/tutorial-todo-crud.md index e4fbad2919..f21939a81f 100755 --- a/doc/md/tutorial-todo-crud.md +++ b/doc/md/tutorial-todo-crud.md @@ -51,7 +51,6 @@ func (Todo) Fields() []ent.Field { Default(0), } } - ``` After adding these fields, we need to run the code-generation as before: From 845e485d8fc4e1d991aa6af66d8cceaf4be88eae Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Sun, 12 Jun 2022 12:11:35 +0300 Subject: [PATCH 3/3] Update doc/md/tutorial-todo-crud.md --- doc/md/tutorial-todo-crud.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/md/tutorial-todo-crud.md b/doc/md/tutorial-todo-crud.md index f21939a81f..6f38b30130 100755 --- a/doc/md/tutorial-todo-crud.md +++ b/doc/md/tutorial-todo-crud.md @@ -39,13 +39,13 @@ func (Todo) Fields() []ent.Field { Default(time.Now). Immutable(), field.Enum("status"). - NamedValues( - "InProgress", "IN_PROGRESS", - "Completed", "COMPLETED", - ). - Annotations( - entgql.OrderField("STATUS") - ), + NamedValues( + "InProgress", "IN_PROGRESS", + "Completed", "COMPLETED", + ). + Annotations( + entgql.OrderField("STATUS"), + ), Default("in_progress"), field.Int("priority"). Default(0),