Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 729 Bytes

deprecation.md

File metadata and controls

36 lines (27 loc) · 729 Bytes

Schema Deprecation

Use the deprecate option when defining any field or enum value.

  • Provide a binary value to give a deprecation reason
  • Provide true to just mark it as deprecated

An example:

query do
  field :old_item, :item, deprecate: true
  field :another_old_item, :item, deprecate: "still too old"
end

You can also use the deprecate as a macro inside a block, for instance:

field :age, :integer do
  deprecate
  arg :user_id, non_null(:id)
end

With a reason:

field :ssn, :string do
  deprecate "Privacy concerns"
end

Warning {: .warning}

Warning: Deprecated fields and enum values are not reported by default during introspection.