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

[backend] Fix null for objectParticipant in Task (#9752) #9755

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Resolvers } from '../../generated/graphql';
import { findAll, findById, taskAdd, taskAddRelation, taskContainsStixObjectOrStixRelationship, taskDelete, taskDeleteRelation, taskEdit } from './task-domain';
import { loadThroughDenormalized } from '../../resolvers/stix';
import { INPUT_PARTICIPANT } from '../../schema/general';

const taskResolvers: Resolvers = {
Query: {
Expand All @@ -9,6 +11,9 @@ const taskResolvers: Resolvers = {
return taskContainsStixObjectOrStixRelationship(context, context.user, args.id, args.stixObjectOrStixRelationshipId);
},
},
Task: {
objectParticipant: (container, _, context) => loadThroughDenormalized(context, context.user, container, INPUT_PARTICIPANT, { sortBy: 'user_email' }),
},
Mutation: {
taskAdd: (_, { input }, context) => taskAdd(context, context.user, input),
taskDelete: (_, { id }, context) => taskDelete(context, context.user, id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type Task implements Container & StixDomainObject & StixCoreObject & StixObject
modified: DateTime
x_opencti_graph_data: String
objectAssignee: [Assignee!]
objectParticipant: [Participant!]
objectParticipant: [Participant!]!
avatar: OpenCtiFile
# Container
authorized_members: [MemberAccess!]
Expand Down