-
-
Save maxloncar/7b774fd9f66bd9f576c8063083941af9 to your computer and use it in GitHub Desktop.
CreateBook file
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
class Mutations::CreateBook < Mutations::BaseMutation | |
argument :title, String, required: true | |
argument :pages, Integer, required: true | |
argument :year_published, Integer, required: false | |
type Types::BookType | |
def resolve(title:, pages:, year_published:) | |
Book.new( | |
title: title, | |
pages: pages, | |
year_published: year_published) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment