Skip to content

Commit 54edbe0

Browse files
committed
Also update resolve to method
1 parent 12ff548 commit 54edbe0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

guides/fields/limits.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ Always limit the number of items which can be returned from a list field. For ex
1616
field :items, Types::ItemType do
1717
# Cap the number of items at 30
1818
argument :limit, Integer, default_value: 20, prepare: ->(limit, ctx) {[limit, 30].min}
19-
resolve ->(obj, args, ctx) {
20-
obj.items.limit(args[:limit])
21-
}
19+
end
20+
21+
def items(limit:)
22+
object.items.limit(limit)
2223
end
2324
```
2425

0 commit comments

Comments
 (0)