diff --git a/graph/generated/generated.go b/graph/generated/generated.go index c0d20b4..f074664 100644 --- a/graph/generated/generated.go +++ b/graph/generated/generated.go @@ -1090,7 +1090,7 @@ enum HashCheckerMode { type HashCheckerConfig { chatNotice: Boolean! hashCheckMode: HashCheckerMode! - subscribedLists(first: Int, after: String): ListConnection! + subscribedLists(first: Int, after: String): ListConnection } type Room { @@ -3077,14 +3077,11 @@ func (ec *executionContext) _HashCheckerConfig_subscribedLists(ctx context.Conte return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } res := resTmp.(*model.ListConnection) fc.Result = res - return ec.marshalNListConnection2ᚖgithubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐListConnection(ctx, field.Selections, res) + return ec.marshalOListConnection2ᚖgithubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐListConnection(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_HashCheckerConfig_subscribedLists(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -10296,9 +10293,6 @@ func (ec *executionContext) _HashCheckerConfig(ctx context.Context, sel ast.Sele } }() res = ec._HashCheckerConfig_subscribedLists(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } return res } @@ -11782,20 +11776,6 @@ func (ec *executionContext) marshalNList2ᚖgithubᚗcomᚋUnkn0wnCatᚋmatrix return ec._List(ctx, sel, v) } -func (ec *executionContext) marshalNListConnection2githubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐListConnection(ctx context.Context, sel ast.SelectionSet, v model.ListConnection) graphql.Marshaler { - return ec._ListConnection(ctx, sel, &v) -} - -func (ec *executionContext) marshalNListConnection2ᚖgithubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐListConnection(ctx context.Context, sel ast.SelectionSet, v *model.ListConnection) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ListConnection(ctx, sel, v) -} - func (ec *executionContext) marshalNListEdge2ᚕᚖgithubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐListEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ListEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup diff --git a/graph/schema.graphqls b/graph/schema.graphqls index a551fca..03d56c6 100644 --- a/graph/schema.graphqls +++ b/graph/schema.graphqls @@ -40,7 +40,7 @@ enum HashCheckerMode { type HashCheckerConfig { chatNotice: Boolean! hashCheckMode: HashCheckerMode! - subscribedLists(first: Int, after: String): ListConnection! + subscribedLists(first: Int, after: String): ListConnection } type Room { diff --git a/webui/data/schema.graphql b/webui/data/schema.graphql index a551fca..03d56c6 100644 --- a/webui/data/schema.graphql +++ b/webui/data/schema.graphql @@ -40,7 +40,7 @@ enum HashCheckerMode { type HashCheckerConfig { chatNotice: Boolean! hashCheckMode: HashCheckerMode! - subscribedLists(first: Int, after: String): ListConnection! + subscribedLists(first: Int, after: String): ListConnection } type Room { diff --git a/webui/src/components/panel/rooms/RoomDetail.tsx b/webui/src/components/panel/rooms/RoomDetail.tsx index 7777670..70f2436 100644 --- a/webui/src/components/panel/rooms/RoomDetail.tsx +++ b/webui/src/components/panel/rooms/RoomDetail.tsx @@ -67,7 +67,7 @@ const RoomDetailInner = ({initialQueryRef}: PropsFinal) => { reconfigureRoom({ variables: { reconfigureInput: { - id: data.room?.id!, + id: data.room!.id!, deactivate: !ev.currentTarget.checked } } @@ -78,7 +78,7 @@ const RoomDetailInner = ({initialQueryRef}: PropsFinal) => { reconfigureRoom({ variables: { reconfigureInput: { - id: data.room?.id!, + id: data.room!.id!, debug: ev.currentTarget.checked } } @@ -103,7 +103,7 @@ const RoomDetailInner = ({initialQueryRef}: PropsFinal) => { reconfigureRoom({ variables: { reconfigureInput: { - id: data.room?.id!, + id: data.room!.id!, adminPowerLevel: newAdminPowerLevel } } @@ -120,7 +120,7 @@ const RoomDetailInner = ({initialQueryRef}: PropsFinal) => { reconfigureRoom({ variables: { reconfigureInput: { - id: data.room?.id!, + id: data.room!.id!, hashChecker: { chatNotice: ev.currentTarget.checked } @@ -134,7 +134,7 @@ const RoomDetailInner = ({initialQueryRef}: PropsFinal) => { reconfigureRoom({ variables: { reconfigureInput: { - id: data.room?.id!, + id: data.room!.id!, hashChecker: { hashCheckMode: ev.currentTarget.value as HashCheckerMode } @@ -159,7 +159,7 @@ const RoomDetailInner = ({initialQueryRef}: PropsFinal) => {
{ - data.room?.hashCheckerConfig.subscribedLists.edges.map((edge) => { + data.room?.hashCheckerConfig.subscribedLists?.edges.map((edge) => { return