Created
March 28, 2020 19:14
-
-
Save endurance/e356c08af649b4f878ed42f2f7ec9991 to your computer and use it in GitHub Desktop.
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
import { Args, Field, ID, Mutation, ObjectType, Resolver } from '@nestjs/graphql'; | |
import { BasinJobService } from '../../general/services/job/basin-job.service'; | |
@ObjectType() | |
class DeleteBasinForJobInput { | |
@Field(_ => ID) | |
public jobId: string; | |
@Field(_ => [String]) | |
public basinNames: string[]; | |
} | |
@ObjectType() | |
class InsertBasinForJobInput { | |
@Field(_ => ID) | |
public jobId: string; | |
@Field(_ => [String]) | |
public basinNames: string[]; | |
} | |
@Resolver() | |
export class BasinJobResolver { | |
constructor( | |
private readonly _basinForJobService: BasinJobService, | |
) {} | |
@Mutation(_ => ID, {name: 'deleteBasinForJob'}) | |
public async deleteBasinForJob( | |
@Args('jobData') data: DeleteBasinForJobInput, | |
) { | |
return await this._basinForJobService.deleteBasinInJobByNames(data.jobId, data.basinNames); | |
} | |
@Mutation(_ => ID, {name: 'insertBasinForJob'}) | |
public async insertBasinForJob( | |
@Args('jobData') data: InsertBasinForJobInput, | |
) { | |
return await this._basinForJobService.insertBasinForJobByNames(data.jobId, data.basinNames); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment