Sha256: 539b28a5b9670fde4a306dd90bdc625e80c3ab8b320734f3c152d919fe3e9b33

Contents?: true

Size: 567 Bytes

Versions: 18

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Metrics/MethodLength

module Osso
  module RouteMap
    def self.included(klass)
      klass.class_eval do
        use Osso::Admin
        use Osso::Auth
        use Osso::Oauth

        post '/graphql' do
          token_protected!

          result = Osso::GraphQL::Schema.execute(
            params[:query],
            variables: params[:variables],
            context: current_user.symbolize_keys,
          )

          json result
        end
      end
    end
  end
end
# rubocop:enable Metrics/MethodLength

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
osso-0.0.5.pre.zeta lib/osso/lib/route_map.rb
osso-0.0.5.pre.epsilon lib/osso/lib/route_map.rb
osso-0.0.5.pre.delta lib/osso/lib/route_map.rb
osso-0.0.5.pre.gamma lib/osso/lib/route_map.rb
osso-0.0.5.pre.beta lib/osso/lib/route_map.rb
osso-0.0.5.pre.alpha lib/osso/lib/route_map.rb
osso-0.0.4 lib/osso/lib/route_map.rb
osso-0.0.3.27 lib/osso/lib/route_map.rb
osso-0.0.3.26 lib/osso/lib/route_map.rb
osso-0.0.3.25 lib/osso/lib/route_map.rb
osso-0.0.3.24 lib/osso/lib/route_map.rb
osso-0.0.3.23 lib/osso/lib/route_map.rb
osso-0.0.3.22 lib/osso/lib/route_map.rb
osso-0.0.3.21 lib/osso/lib/route_map.rb
osso-0.0.3.20 lib/osso/lib/route_map.rb
osso-0.0.3.19 lib/osso/lib/route_map.rb
osso-0.0.3.18 lib/osso/lib/route_map.rb
osso-0.0.3.17 lib/osso/lib/route_map.rb