doc/md: fix NamedValues option in graphql tutorial (#2535)

* doc/md: fixing NamedValues option in Add Fields To The Schema example

* Update doc/md/tutorial-todo-crud.md

* Update doc/md/tutorial-todo-crud.md

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
This commit is contained in:
Dor Liberman
2022-06-12 12:12:25 +03:00
committed by GitHub
parent bfa9c963cb
commit 1572f1eb14

View File

@@ -39,7 +39,13 @@ 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),