| Sep | OCT | Nov |
| 04 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.
The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.
This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.
Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.
The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.
Collection: Archive Team: The Github Hitrub
graphql gem which allows queries to be batched.
gem 'graphql-batch'And then execute:
$ bundle
Or install it yourself as:
$ gem install graphql-batch
require 'graphql/batch'Define a custom loader, which is initialized with arguments that are used for grouping and a perform method for performing the batch load.
class RecordLoader < GraphQL::Batch::Loader def initialize(model) @model = model end def perform(ids) @model.where(id: ids).each { |record| fulfill(record.id, record) } ids.each { |id| fulfill(id, nil) unless fulfilled?(id) } end endUse
GraphQL::Batch as a plugin in your schema (for graphql >= 1.5.0).
MySchema = GraphQL::Schema.define do query MyQueryType use GraphQL::Batch endFor pre
1.5.0 versions:
MySchema = GraphQL::Schema.define do query MyQueryType GraphQL::Batch.use(self) endThe loader class can be used from the resolve proc for a graphql field by calling
.for with the grouping arguments to get a loader instance, then call .load on that instance with the key to load.
resolve -> (obj, args, context) { RecordLoader.for(Product).load(args["id"]) }Although this library doesn't have a dependency on active record, the examples directory has record and association loaders for active record which handles edge cases like type casting ids and overriding GraphQL::Batch::Loader#cache_key to load associations on records with the same id.
.then
resolve -> (obj, args, context) do RecordLoader.for(Product).load(args["id"]).then do |product| product.title end endYou may also need to do another query that depends on the first one to get the result, in which case the query block can return another query.
resolve -> (obj, args, context) do RecordLoader.for(Product).load(args["id"]).then do |product| RecordLoader.for(Image).load(product.image_id) end endIf the second query doesn't depend on the first one, then you can use Promise.all, which allows each query in the group to be batched with other queries.
resolve -> (obj, args, context) do Promise.all([ CountLoader.for(Shop, :smart_collections).load(context.shop_id), CountLoader.for(Shop, :custom_collections).load(context.shop_id), ]).then do |results| results.reduce(&:+) end end
.then can optionally take two lambda arguments, the first of which is equivalent to passing a block to .then, and the second one handles exceptions. This can be used to provide a fallback
resolve -> (obj, args, context) do CacheLoader.for(Product).load(args["id"]).then(nil, lambda do |exc| raise exc unless exc.is_a?(Redis::BaseConnectionError) logger.warn err.message RecordLoader.for(Product).load(args["id"]) end) end
def test_single_query product = products(:snowboard) title = GraphQL::Batch.batch do RecordLoader.for(Product).load(product.id).then(&:title) end assert_equal product.title, title end
bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.