Sha256: 12f5adf829dc083bdaeec94217df552a35fb8e96331399f8050fd0c505ddb42a
Contents?: true
Size: 458 Bytes
Versions: 10
Compression:
Stored size: 458 Bytes
Contents
# frozen_string_literal: true require_relative './base' require_relative './node' module GQLi # Fragment wrapper class Fragment < Base attr_reader :__on_type def initialize(name, on, &block) super(name, 0, &block) @__on_type = on end # Serializes to a GraphQL string def to_gql <<~GQL fragment #{__name} on #{__on_type} { #{__nodes.map(&:to_gql).join("\n")} } GQL end end end
Version data entries
10 entries across 10 versions & 1 rubygems