-
-
Save maxloncar/74a974536bba32d92141836474746873 to your computer and use it in GitHub Desktop.
QueryType class
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 Types | |
class QueryType < Types::BaseObject | |
field :authors, [Types::AuthorType], null: false | |
def authors | |
Author.all | |
end | |
field :author, Types::AuthorType, null: false do | |
argument :id, ID, required: true | |
end | |
def author(id:) | |
Author.find(id) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment