Skip to content

Files

Latest commit

 

History

History
36 lines (26 loc) · 710 Bytes

GraphQL-OrderedFields.md

File metadata and controls

36 lines (26 loc) · 710 Bytes

Pattern: Wrong field order

Issue: -

Description

Fields should be alphabetically sorted within groups.

Examples

# good
class UserType < BaseType
  field :name, String, null: true
  field :phone, String, null: true do
    argument :something, String, required: false
  end
end

# good
class UserType < BaseType
  field :phone, String, null: true

  field :name, String, null: true
end

# bad
class UserType < BaseType
  field :phone, String, null: true
  field :name, String, null: true
end

Further Reading