Created
September 14, 2017 20:13
-
-
Save giovannibenussi/a0442d51e912666b95dcd02fad22f0ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Validators | |
class Model | |
def self.validate!(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 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment