Sha256: d85a76ed5d99b3100a73ad6444581e6e9c3bbf71b2ee14aeeccbe4a124c5fcc8

Contents?: true

Size: 522 Bytes

Versions: 15

Compression:

Stored size: 522 Bytes

Contents

module GraphitiGraphQL
  module GraphitiSchema
    class Wrapper
      attr_reader :schema

      def initialize(schema)
        @schema = schema
      end

      def get_resource(name)
        config = schema[:resources].find { |r| r[:name] == name }
        raise "Could not find resource #{name} in schema" unless config
        Resource.new(self, schema[:resources].find { |r| r[:name] == name })
      end

      def resources
        schema[:resources].map { |r| get_resource(r[:name]) }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
graphiti_graphql-0.1.17 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.16 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.15 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.14 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.12 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.11 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.10 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.9 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.8 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.7 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.6 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.5 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.4 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.3 lib/graphiti_graphql/graphiti_schema/wrapper.rb
graphiti_graphql-0.1.2 lib/graphiti_graphql/graphiti_schema/wrapper.rb