Last active
September 14, 2017 20:30
-
-
Save giovannibenussi/fa2c4958940e792d6cd003951e5d3191 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
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]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment