Last active
May 7, 2019 19:27
-
-
Save valikos/649261bbf9d6db18b92fe3c666ebd121 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Types::ResultType < Types::BaseUnion | |
possible_types Types::CharacterType, Types::LandType, Types::BuildingType | |
# Optional: if this method is defined, it will override `Schema.resolve_type` | |
def self.resolve_type(object, context) | |
if object.is_a?(Character) | |
Types::CharacterType | |
elsif object.is_a?(Land) | |
Types::LandType | |
else | |
Types::BuildingType | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment