giovannibenussi
9/14/2017 - 8:11 PM

validate-graphql-ruby-0.rb

resolve lambda { |_, args, _|
    unless args[:name].present?
        raise GraphQL::ExecutionError, 'You must provide a value for name'
    end
    unless args[:address].present?
        raise GraphQL::ExecutionError, 'You must provide a value for address'
    end
    Model.find_by(address: args[:address], name: args[:name])
}