Absinthe.Federation.Notation.key_fields
You're seeing just the macro
key_fields
, go back to Absinthe.Federation.Notation module for more information.
Adds a @key
directive to the type which indicates a combination of fields
that can be used to uniquely identify and fetch an object or interface.
This allows the type to be extended by other services.
A string rather than atom is used here to support composite keys e.g. id organization { id }
Example
object :user do
key_fields("id")
field :id, non_null(:id)
end
SDL Output
type User @key(fields: "id") {
id: ID!
}