You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: with_fields.rb
    path of file: ./repos/rails-graphql/lib/rails/graphql/helpers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Rails
  module GraphQL
    
        def validate!(*)
          super if defined? super

          # TODO: Maybe find a way to freeze the fields, since after validation
          # the best thing to do is block changes
          fields&.each_value(&:validate!)
        end

        # Find a specific field using its id as +gql_name.type+
        def find_by_gid(gid)
          find_field!(gid.name)
        end

        protected

          # A little helper to define arguments using the :arguments key
          def argument(*args, **xargs, &block)
            xargs[:owner] = self
            GraphQL::Argument.new(*args, **xargs, &block)
          end

          alias arg argument

        private

          def lazy_each_field
            fields.each_pair.lazy.each_entry.map(&:last) if fields?
          end
      end