Skip to content
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

Merged
merged 15 commits into from
Jan 9, 2024
Merged

Hw12 harb #141

merged 15 commits into from
Jan 9, 2024

Conversation

Tomax47
Copy link
Contributor

@Tomax47 Tomax47 commented Dec 3, 2023

Mutations :
Destroy project
Create task
Destroy task

Type :
Comment

Added mutations for creating and destroying the task
Note : Task destroy works if to disable the notifier part in the interactor -> yet to figure out
Added comment type & comment\s resolvers
@Tomax47 Tomax47 marked this pull request as ready for review December 3, 2023 21:53
Comment on lines 4 to 5
argument :input, Types::Inputs::CreateTaskInput, required: true
argument :project_id, ID, required: true
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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

type Types::Payloads::TaskPayload

def resolve(input:, project_id:)
@project = Project.find(project_id)
Copy link
Contributor

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?

Suggested change
@project = Project.find(project_id)
project = Project.find(project_id)

argument :id, ID, required: true
end
end
end
Copy link
Contributor

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

@DenisZackharov DenisZackharov self-assigned this Dec 4, 2023
@DenisZackharov
Copy link
Contributor

Also please resolve conflicts

Copy link
Contributor

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

Comment on lines 9 to 10
@task = Task.find(input.id)
@project = Project.find(input.project_id)
Copy link
Contributor

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

Suggested change
@task = Task.find(input.id)
@project = Project.find(input.project_id)
task = Task.find(input.id)
project = Project.find(input.project_id)

@DenisZackharov
Copy link
Contributor

Resolve conflicts and my comments please

@AndreyBartnovskiy
Copy link
Contributor

Принято! Не забывай про Rubocop

@DenisZackharov DenisZackharov merged commit 5b8e28b into fs:master Jan 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants