Skip to content

Files

Latest commit

 

History

History
37 lines (25 loc) · 741 Bytes

GraphQL-MultipleFieldDefinitions.md

File metadata and controls

37 lines (25 loc) · 741 Bytes

Pattern: Ungrouped multiple field definitions

Issue: -

Description

Checks whether fields with multiple definitions are grouped together.

Examples

# good

class UserType < BaseType
  field :first_name, String, null: true
  field :first_name, Name, null: true

  def first_name
    object.contact_data.first_name
  end
end

# bad

class UserType < BaseType
  field :first_name, String, null: true

  def first_name
    object.contact_data.first_name
  end
  field :first_name, Name, null: true
end

Further Reading