Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 656 Bytes

File metadata and controls

17 lines (13 loc) · 656 Bytes

Alternative hash functions

apollo-link-persisted-queries uses SHA256 by default so this gem uses it as a default too, but if you want to override it – you can use :hash_generator option:

class GraphqlSchema < GraphQL::Schema
  use GraphQL::PersistedQueries, hash_generator: :md5
end

If string or symbol is passed – the gem would try to find the class in the Digest namespace. Altenatively, you can pass a lambda, e.g.:

class GraphqlSchema < GraphQL::Schema
  use GraphQL::PersistedQueries, hash_generator: proc { |_value| "super_safe_hash!!!" }
end