Skip to content

Bug: GraphQL/OrderedFields moves field from one class to another #179

@TSMMark

Description

@TSMMark

Hello, firstly thanks for this great gem — we've been using it for years and love it ❤️


I have these 3 class definitions in one file

module ProtectedIntrospection

  class DynamicFields < GraphQL::Introspection::DynamicFields

    field_class HideIntrospectionByContextBaseField
    field :__typename, String, null: false

  end

  class EntryPoints < GraphQL::Introspection::EntryPoints

    field_class HideIntrospectionByContextBaseField
    field :__type, GraphQL::Introspection::TypeType do
      argument :name, String
    end

  end

  class SchemaType < GraphQL::Introspection::SchemaType

    extend HideIntrospectionByContext

  end

end

GraphQL/OrderedFields cop wants to move the __type field to the topmost class like this:

module ProtectedIntrospection

  class DynamicFields < GraphQL::Introspection::DynamicFields

    field_class HideIntrospectionByContextBaseField
    field :__type, GraphQL::Introspection::TypeType do
      argument :name, String
    end
    field :__typename, String, null: false

  end

  class EntryPoints < GraphQL::Introspection::EntryPoints

    field_class HideIntrospectionByContextBaseField

  end

  class SchemaType < GraphQL::Introspection::SchemaType

    extend HideIntrospectionByContext

  end

end

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions