Sha256: 780deea5bd20518170beab1c6debfa7d79747727dc1acb1f6bfe03b04f50a949

Contents?: true

Size: 288 Bytes

Versions: 58

Compression:

Stored size: 288 Bytes

Contents

# frozen_string_literal: true

module Ibrain
  module Extentions
    class DefaultValue < GraphQL::Schema::FieldExtension
      def after_resolve(value:, **_rest)
        if value.nil?
          options[:default_value]
        else
          value
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
ibrain-core-0.5.15 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.13 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.12 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.10 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.9 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.8 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.7 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.6 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.5 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.4 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.3 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.2 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.1 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.5.0 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.4.9 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.4.8 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.4.7 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.4.5 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.4.4 app/graphql/ibrain/extentions/default_value.rb
ibrain-core-0.4.3 app/graphql/ibrain/extentions/default_value.rb