Skip to main content

slice

Returns a subset of an array OR string by start/end index. Supports negative indices. Example: _fn @array(refs: ["a", "b", "c"]) @slice(start: 0, end: 2) returns the first two elements.

directive @slice(
start: Int
end: Int
) on FIELD

Arguments

slice.start ● Int scalar

slice.end ● Int scalar