Sha256: 5b0db0b3f78a33118160f002d79c854089a5044ddc18408481e78d25bfadd1a8

Contents?: true

Size: 484 Bytes

Versions: 15

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

class Grumlin::Middlewares::BuildQuery < Grumlin::Middlewares::Middleware
  def call(env)
    env[:query] = {
      requestId: SecureRandom.uuid,
      op: :bytecode,
      processor: env[:session_id] ? :session : :traversal,
      args: {
        gremlin: {
          :@type => "g:Bytecode",
          :@value => env[:bytecode]
        },
        aliases: { g: :g },
        session: env[:session_id]
      }.compact
    }
    @app.call(env)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
grumlin-1.2.0 lib/grumlin/middlewares/build_query.rb
grumlin-1.1.0 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.4 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.3 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.3.beta1 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.2 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.1 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc7 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc6 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc5 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc4 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc3 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc2 lib/grumlin/middlewares/build_query.rb
grumlin-1.0.0.rc1 lib/grumlin/middlewares/build_query.rb