Skip to content

Files

Latest commit

 

History

History
39 lines (29 loc) · 904 Bytes

GraphQL-ExtractType.md

File metadata and controls

39 lines (29 loc) · 904 Bytes

Pattern: Missing use of new type

Issue: -

Description

Checks fields on common prefix groups.

Examples

# good
class Types::UserType < Types::BaseObject
  field :registered_at, String, null: false
  field :contact, Types::ContactType, null: false

  def contact
    self
  end
end

class Types::ContactType < Types::BaseObject
  field :phone, String, null: false
  field :first_name, String, null: false
  field :last_name, String, null: false
end

# bad
class Types::UserType < Types::BaseObject
  field :registered_at, String, null: false
  field :contact_phone, String, null: false
  field :contact_first_name, String, null: false
  field :contact_last_name, String, null: false
end

Further Reading