Class: Types::UntrustedRegexp
- Inherits:
-
BaseScalar
- Object
- GraphQL::Schema::Scalar
- BaseScalar
- Types::UntrustedRegexp
- Defined in:
- app/graphql/types/untrusted_regexp.rb
Class Method Summary collapse
Class Method Details
.coerce_input(input_value, _) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/graphql/types/untrusted_regexp.rb', line 7 def self.coerce_input(input_value, _) return unless input_value Gitlab::UntrustedRegexp.new(input_value) input_value rescue RegexpError => e = "#{input_value} is an invalid regexp: #{e.}" raise GraphQL::CoercionError, end |
.coerce_result(ruby_value, _) ⇒ Object
18 19 20 |
# File 'app/graphql/types/untrusted_regexp.rb', line 18 def self.coerce_result(ruby_value, _) ruby_value.to_s end |