def inline_fragment_ast(type, with_children: true)
      selections = []
      if with_children
        type.all_fields.each do |field|
          field_type = field.type.unwrap
          if node_field?(field) && include?(field_type)
            selections << node_field_ast(field)
          elsif connection_field?(field) && include?(field_type)
            selections << connection_field_ast(field)
          end
        end
      elsif id = type.get_field('id')
        selections << field_ast(id)
      end

      selections.compact!

      if selections.none?
        nil
      else
        GraphQL::Language::Nodes::InlineFragment.new(
          type: make_type_name_node(type.name),
          selections: selections,
        )
      end
    end
def inline_fragment_ast(type, with_children: true)
      selections = []
      if with_children
        type.all_fields.each do |field|
          field_type = field.type.unwrap
          if node_field?(field) && include?(field_type)
            selections << node_field_ast(field)
          elsif connection_field?(field) && include?(field_type)
            selections << connection_field_ast(field)
          end
        end
      elsif id = type.get_field('id')
        selections << field_ast(id)
      end

      selections.compact!

      if selections.none?
        nil
      else
        GraphQL::Language::Nodes::InlineFragment.new(
          type: make_type_name_node(type.name),
          selections: selections,
        )
      end
    end
Make an inline fragment AST.

 type           - The GraphQL::ObjectType instance to make the fragment
                  for.
 with_children: - Boolean. Whether to select all children of this inline
                  fragment, or just it's ID.

 Returns a GraphQL::Language::Nodes::InlineFragment instance or nil if the
 created AST was invalid for having no selections.