From c63ad9125200b17c03a35fa04886cd74fbfcec42 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Wed, 11 Oct 2023 19:08:12 -0600 Subject: [PATCH] Added mutations for add/remove members --- gql.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gql.go b/gql.go index 18530f5..c921700 100644 --- a/gql.go +++ b/gql.go @@ -1167,12 +1167,20 @@ func NewGQLExtContext() *GQLExtContext { panic(err) } - context.Mutation.AddFieldConfig("stop", &graphql.Field{ - Type: graphql.String, - Resolve: func(p graphql.ResolveParams) (interface{}, error) { - return nil, fmt.Errorf("NOT_IMPLEMENTED") - }, - }) + err = context.AddSignalMutation("stop", "node_id", reflect.TypeOf(StopSignal{})) + if err != nil { + panic(err) + } + + err = context.AddSignalMutation("addMember", "group_id", reflect.TypeOf(AddMemberSignal{})) + if err != nil { + panic(err) + } + + err = context.AddSignalMutation("removeMember", "group_id", reflect.TypeOf(RemoveMemberSignal{})) + if err != nil { + panic(err) + } context.Subscription.AddFieldConfig("Self", &graphql.Field{ Type: context.Interfaces["Node"].Interface,