Sha256: 15546b9da01bd3210f86ed9664820d2fa93a018d52f3ae7e3bd77cdffe3e3934

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

module GraphitiGraphQL
  module Federation
    class FederatedResource
      attr_reader :type_name, :relationships

      def initialize(type_name)
        @type_name = type_name
        @relationships = {}
      end

      def add_relationship(
        kind,
        name,
        local_resource_class,
        foreign_key,
        &blk
      )
        @relationships[name] = FederatedRelationship
          .new(kind, name, local_resource_class, foreign_key)
        if blk
          @relationships[name].instance_eval(&blk)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphiti_graphql-0.1.4 lib/graphiti_graphql/federation/federated_resource.rb
graphiti_graphql-0.1.3 lib/graphiti_graphql/federation/federated_resource.rb
graphiti_graphql-0.1.2 lib/graphiti_graphql/federation/federated_resource.rb