-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hw12 harb #141
Hw12 harb #141
Conversation
app/graphql/mutations/create_task.rb
Outdated
argument :input, Types::Inputs::CreateTaskInput, required: true | ||
argument :project_id, ID, required: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have input, please pass project_id
in input too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in all others mutations
@@ -0,0 +1,14 @@ | |||
module Mutations | |||
class DestroyProject < BaseMutation | |||
argument :input, Types::Inputs::DestroyProjectInput, required: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, you can use just argument :id, ID, required: true
app/graphql/mutations/create_task.rb
Outdated
type Types::Payloads::TaskPayload | ||
|
||
def resolve(input:, project_id:) | ||
@project = Project.find(project_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you needed instance variable here?
@project = Project.find(project_id) | |
project = Project.find(project_id) |
argument :id, ID, required: true | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an empty line in the end of file
Also please resolve conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just need id here, and you can take task by id, and project by task
@task = Task.find(input.id) | ||
@project = Project.find(input.project_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need instance variable
@task = Task.find(input.id) | |
@project = Project.find(input.project_id) | |
task = Task.find(input.id) | |
project = Project.find(input.project_id) |
Resolve conflicts and my comments please |
Принято! Не забывай про Rubocop |
Mutations :
Destroy project
Create task
Destroy task
Type :
Comment