Skip to main content

unique

Removes duplicate values from an array, preserving order. Without 'field', values are compared directly (scalars by value; objects are never considered duplicates). With 'field', a dot-separated path (see 'map' for path syntax) is resolved on each element and elements are deduplicated by that value instead, keeping the first occurrence. Example: _fn @unique(refs: ["a", "b"]) returns only distinct values; _fn @unique(refs: ["items"], field: "jobTitle") keeps the first item per distinct jobTitle.

directive @unique(
ref: String
refs: [String!]
field: String
) on FIELD

Arguments

unique.ref ● String scalar

unique.refs ● [String!] list scalar

unique.field ● String scalar