mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-04-30 10:46:53 +02:00
api: Fix Room query
This commit is contained in:
parent
cbd1aeb04a
commit
adf8bc3ee0
10 changed files with 800 additions and 105 deletions
|
@ -88,8 +88,9 @@ type ComplexityRoot struct {
|
|||
}
|
||||
|
||||
HashCheckerConfig struct {
|
||||
ChatNotice func(childComplexity int) int
|
||||
HashCheckMode func(childComplexity int) int
|
||||
ChatNotice func(childComplexity int) int
|
||||
HashCheckMode func(childComplexity int) int
|
||||
SubscribedLists func(childComplexity int) int
|
||||
}
|
||||
|
||||
List struct {
|
||||
|
@ -155,9 +156,8 @@ type ComplexityRoot struct {
|
|||
}
|
||||
|
||||
RoomConnection struct {
|
||||
Edges func(childComplexity int) int
|
||||
PageInfo func(childComplexity int) int
|
||||
SubscribedLists func(childComplexity int) int
|
||||
Edges func(childComplexity int) int
|
||||
PageInfo func(childComplexity int) int
|
||||
}
|
||||
|
||||
RoomEdge struct {
|
||||
|
@ -389,6 +389,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
|||
|
||||
return e.complexity.HashCheckerConfig.HashCheckMode(childComplexity), true
|
||||
|
||||
case "HashCheckerConfig.subscribedLists":
|
||||
if e.complexity.HashCheckerConfig.SubscribedLists == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.HashCheckerConfig.SubscribedLists(childComplexity), true
|
||||
|
||||
case "List.comments":
|
||||
if e.complexity.List.Comments == nil {
|
||||
break
|
||||
|
@ -800,13 +807,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
|||
|
||||
return e.complexity.RoomConnection.PageInfo(childComplexity), true
|
||||
|
||||
case "RoomConnection.subscribedLists":
|
||||
if e.complexity.RoomConnection.SubscribedLists == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.RoomConnection.SubscribedLists(childComplexity), true
|
||||
|
||||
case "RoomEdge.cursor":
|
||||
if e.complexity.RoomEdge.Cursor == nil {
|
||||
break
|
||||
|
@ -990,6 +990,7 @@ enum HashCheckerMode {
|
|||
type HashCheckerConfig {
|
||||
chatNotice: Boolean!
|
||||
hashCheckMode: HashCheckerMode!
|
||||
subscribedLists: [ID!]
|
||||
}
|
||||
|
||||
type Room {
|
||||
|
@ -1004,7 +1005,6 @@ type Room {
|
|||
type RoomConnection {
|
||||
pageInfo: PageInfo!
|
||||
edges: [RoomEdge!]!
|
||||
subscribedLists: [ID!]
|
||||
}
|
||||
|
||||
type RoomEdge {
|
||||
|
@ -2595,6 +2595,38 @@ func (ec *executionContext) _HashCheckerConfig_hashCheckMode(ctx context.Context
|
|||
return ec.marshalNHashCheckerMode2githubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐHashCheckerMode(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _HashCheckerConfig_subscribedLists(ctx context.Context, field graphql.CollectedField, obj *model.HashCheckerConfig) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
fc := &graphql.FieldContext{
|
||||
Object: "HashCheckerConfig",
|
||||
Field: field,
|
||||
Args: nil,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
}
|
||||
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.SubscribedLists, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.([]string)
|
||||
fc.Result = res
|
||||
return ec.marshalOID2ᚕstringᚄ(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _List_id(ctx context.Context, field graphql.CollectedField, obj *model.List) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
@ -4682,38 +4714,6 @@ func (ec *executionContext) _RoomConnection_edges(ctx context.Context, field gra
|
|||
return ec.marshalNRoomEdge2ᚕᚖgithubᚗcomᚋUnkn0wnCatᚋmatrixᚑvelesᚋgraphᚋmodelᚐRoomEdgeᚄ(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _RoomConnection_subscribedLists(ctx context.Context, field graphql.CollectedField, obj *model.RoomConnection) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
fc := &graphql.FieldContext{
|
||||
Object: "RoomConnection",
|
||||
Field: field,
|
||||
Args: nil,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
}
|
||||
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.SubscribedLists, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.([]string)
|
||||
fc.Result = res
|
||||
return ec.marshalOID2ᚕstringᚄ(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) _RoomEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RoomEdge) (ret graphql.Marshaler) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
@ -7558,6 +7558,8 @@ func (ec *executionContext) _HashCheckerConfig(ctx context.Context, sel ast.Sele
|
|||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "subscribedLists":
|
||||
out.Values[i] = ec._HashCheckerConfig_subscribedLists(ctx, field, obj)
|
||||
default:
|
||||
panic("unknown field " + strconv.Quote(field.Name))
|
||||
}
|
||||
|
@ -8036,8 +8038,6 @@ func (ec *executionContext) _RoomConnection(ctx context.Context, sel ast.Selecti
|
|||
if out.Values[i] == graphql.Null {
|
||||
invalids++
|
||||
}
|
||||
case "subscribedLists":
|
||||
out.Values[i] = ec._RoomConnection_subscribedLists(ctx, field, obj)
|
||||
default:
|
||||
panic("unknown field " + strconv.Quote(field.Name))
|
||||
}
|
||||
|
|
|
@ -528,7 +528,7 @@ func ResolveComments(comments []*model2.DBComment, first *int, after *string) (*
|
|||
}, nil
|
||||
}
|
||||
|
||||
func buildDBRoomFilter(first *int, after *string, filter *model.RoomFilter /*, sort *model.UserSort*/, userId primitive.ObjectID) (*bson.M, *bson.M, *int64, error) {
|
||||
func buildDBRoomFilter(first *int, after *string, filter *model.RoomFilter /*, sort *model.UserSort*/, userMxids []string) (*bson.M, *bson.M, *int64, error) {
|
||||
compiledFilter := bson.M{}
|
||||
compiledSort := bson.M{}
|
||||
|
||||
|
@ -581,7 +581,9 @@ func buildDBRoomFilter(first *int, after *string, filter *model.RoomFilter /*, s
|
|||
}
|
||||
|
||||
if filter.CanEdit != nil && *filter.CanEdit == true {
|
||||
filterBsonW["admins"] = userId
|
||||
filterBsonW["admins"] = bson.M{
|
||||
"$in": userMxids,
|
||||
}
|
||||
}
|
||||
|
||||
filterBson = &filterBsonW
|
||||
|
|
|
@ -164,9 +164,8 @@ type RoomConfigUpdate struct {
|
|||
}
|
||||
|
||||
type RoomConnection struct {
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
Edges []*RoomEdge `json:"edges"`
|
||||
SubscribedLists []string `json:"subscribedLists"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
Edges []*RoomEdge `json:"edges"`
|
||||
}
|
||||
|
||||
type RoomEdge struct {
|
||||
|
|
|
@ -40,6 +40,7 @@ enum HashCheckerMode {
|
|||
type HashCheckerConfig {
|
||||
chatNotice: Boolean!
|
||||
hashCheckMode: HashCheckerMode!
|
||||
subscribedLists: [ID!]
|
||||
}
|
||||
|
||||
type Room {
|
||||
|
@ -54,7 +55,6 @@ type Room {
|
|||
type RoomConnection {
|
||||
pageInfo: PageInfo!
|
||||
edges: [RoomEdge!]!
|
||||
subscribedLists: [ID!]
|
||||
}
|
||||
|
||||
type RoomEdge {
|
||||
|
|
|
@ -906,13 +906,17 @@ func (r *queryResolver) Entries(ctx context.Context, first *int, after *string,
|
|||
}
|
||||
|
||||
func (r *queryResolver) Rooms(ctx context.Context, first *int, after *string, filter *model.RoomFilter) (*model.RoomConnection, error) {
|
||||
userId, _ := GetUserIDFromContext(ctx)
|
||||
user, _ := GetUserFromContext(ctx)
|
||||
|
||||
if userId == nil {
|
||||
userId = &primitive.ObjectID{}
|
||||
var userMxids []string
|
||||
|
||||
if user != nil {
|
||||
for _, mxid := range user.MatrixLinks {
|
||||
userMxids = append(userMxids, *mxid)
|
||||
}
|
||||
}
|
||||
|
||||
dbFilter, dbSort, dbLimit, err := buildDBRoomFilter(first, after, filter, *userId)
|
||||
dbFilter, dbSort, dbLimit, err := buildDBRoomFilter(first, after, filter, userMxids)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ scalar Time
|
|||
directive @loggedIn on FIELD_DEFINITION
|
||||
directive @hasRole(role: UserRole!) on FIELD_DEFINITION
|
||||
directive @owner on FIELD_DEFINITION
|
||||
directive @maintainer on FIELD_DEFINITION
|
||||
|
||||
enum UserRole {
|
||||
ADMIN
|
||||
|
@ -31,6 +30,38 @@ input SortRule {
|
|||
direction: SortDirection!
|
||||
}
|
||||
|
||||
enum HashCheckerMode {
|
||||
NOTICE # Just post a notice
|
||||
DELETE # Delete message, post notice
|
||||
MUTE # Mute user, delete message, post notice
|
||||
BAN # Ban user, delete message, post notice
|
||||
}
|
||||
|
||||
type HashCheckerConfig {
|
||||
chatNotice: Boolean!
|
||||
hashCheckMode: HashCheckerMode!
|
||||
subscribedLists: [ID!]
|
||||
}
|
||||
|
||||
type Room {
|
||||
id: ID!
|
||||
active: Boolean!
|
||||
roomId: String!
|
||||
debug: Boolean!
|
||||
adminPowerLevel: Int!
|
||||
hashCheckerConfig: HashCheckerConfig!
|
||||
}
|
||||
|
||||
type RoomConnection {
|
||||
pageInfo: PageInfo!
|
||||
edges: [RoomEdge!]!
|
||||
}
|
||||
|
||||
type RoomEdge {
|
||||
node: Room!
|
||||
cursor: String!
|
||||
}
|
||||
|
||||
type User {
|
||||
id: ID!
|
||||
|
||||
|
@ -198,10 +229,19 @@ input EntrySort {
|
|||
addedBy: SortRule
|
||||
}
|
||||
|
||||
input RoomFilter {
|
||||
id: ID
|
||||
active: Boolean
|
||||
debug: Boolean
|
||||
canEdit: Boolean
|
||||
}
|
||||
|
||||
type Query {
|
||||
users(first: Int, after: String, filter: UserFilter, sort: UserSort): UserConnection @loggedIn
|
||||
lists(first: Int, after: String, filter: ListFilter, sort: ListSort): ListConnection @loggedIn
|
||||
entries(first: Int, after: String, filter: EntryFilter, sort: EntrySort): EntryConnection @loggedIn
|
||||
rooms(first: Int, after: String, filter: RoomFilter): RoomConnection @loggedIn
|
||||
|
||||
|
||||
user(id: ID, username: String): User @loggedIn
|
||||
entry(id: ID, hashValue: String): Entry @loggedIn
|
||||
|
@ -264,12 +304,25 @@ input RemoveMXID {
|
|||
mxid: String!
|
||||
}
|
||||
|
||||
input RoomConfigUpdate {
|
||||
debug: Boolean
|
||||
adminPowerLevel: Int
|
||||
hashChecker: HashCheckerConfigUpdate
|
||||
}
|
||||
|
||||
input HashCheckerConfigUpdate {
|
||||
chatNotice: Boolean
|
||||
hashCheckMode: HashCheckerMode
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
login(input: Login!): String!
|
||||
register(input: Register!): String! @hasRole(role: UNAUTHENTICATED)
|
||||
addMXID(input: AddMXID!): User! @loggedIn
|
||||
removeMXID(input: RemoveMXID!): User! @loggedIn
|
||||
|
||||
reconfigureRoom(input: RoomConfigUpdate!): Room! @loggedIn
|
||||
|
||||
createEntry(input: CreateEntry!): Entry! @loggedIn
|
||||
commentEntry(input: CommentEntry!): Entry! @loggedIn
|
||||
addToLists(input: AddToLists!): Entry! @loggedIn
|
||||
|
|
|
@ -1,42 +1,76 @@
|
|||
import React from "react";
|
||||
import React, {useCallback} from "react";
|
||||
import {graphql} from "babel-plugin-relay/macro";
|
||||
|
||||
|
||||
import {PreloadedQuery, usePreloadedQuery} from "react-relay/hooks";
|
||||
import {PreloadedQuery, usePaginationFragment, usePreloadedQuery} from "react-relay/hooks";
|
||||
import {DashboardQuery} from "./__generated__/DashboardQuery.graphql";
|
||||
import {Trans} from "react-i18next";
|
||||
import {DashboardListsQuery} from "./__generated__/DashboardListsQuery.graphql";
|
||||
import {DashboardQueryLists$data, DashboardQueryLists$key} from "./__generated__/DashboardQueryLists.graphql";
|
||||
|
||||
type Props = {
|
||||
initialQueryRef: PreloadedQuery<DashboardQuery>,
|
||||
}
|
||||
|
||||
const Dashboard = (props: Props) => {
|
||||
const data = usePreloadedQuery(
|
||||
const data = usePreloadedQuery<DashboardQuery>(
|
||||
graphql`
|
||||
query DashboardQuery {
|
||||
query DashboardQuery($first: String, $count: Int) {
|
||||
self {
|
||||
username
|
||||
id
|
||||
admin
|
||||
}
|
||||
...DashboardQueryLists
|
||||
}
|
||||
`,
|
||||
props.initialQueryRef
|
||||
)
|
||||
|
||||
const {data: d2, hasNext, loadNext, refetch} = usePaginationFragment<DashboardListsQuery, DashboardQueryLists$key>(
|
||||
graphql`
|
||||
fragment DashboardQueryLists on Query @refetchable(queryName: "DashboardListsQuery") {
|
||||
rooms(after: $first, first: $count, filter: {canEdit: true}) @connection(key: "DashboardQueryLists_rooms") {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
active
|
||||
debug
|
||||
hashCheckerConfig {
|
||||
chatNotice
|
||||
hashCheckMode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
// @ts-ignore
|
||||
data
|
||||
)
|
||||
|
||||
const refresh = useCallback(() => {
|
||||
refetch({}, {fetchPolicy: "network-only"})
|
||||
}, [])
|
||||
|
||||
|
||||
const name = data.self?.username
|
||||
|
||||
return <>
|
||||
<h1><Trans i18nKey={"dashboard.helloText"}>Ayo {{name}}!</Trans></h1>
|
||||
|
||||
{/*<button onClick={refresh}>Refresh</button>*/}
|
||||
{<button onClick={refresh}>Refresh</button>}
|
||||
|
||||
{/*hasNext && <button
|
||||
<pre>{
|
||||
JSON.stringify(d2, null, 2)
|
||||
}</pre>
|
||||
|
||||
{hasNext && <button
|
||||
onClick={() => {
|
||||
loadNext(2)
|
||||
}}>
|
||||
Load more Entries
|
||||
</button>*/}
|
||||
</button>}
|
||||
</>
|
||||
}
|
||||
|
||||
|
|
223
webui/src/components/dashboard/__generated__/DashboardListsQuery.graphql.ts
generated
Normal file
223
webui/src/components/dashboard/__generated__/DashboardListsQuery.graphql.ts
generated
Normal file
|
@ -0,0 +1,223 @@
|
|||
/**
|
||||
* @generated SignedSource<<c756e72cff23f484ecd35ba7ddaa2c80>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DashboardListsQuery$variables = {
|
||||
count?: number | null;
|
||||
first?: string | null;
|
||||
};
|
||||
export type DashboardListsQuery$data = {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"DashboardQueryLists">;
|
||||
};
|
||||
export type DashboardListsQuery = {
|
||||
variables: DashboardListsQuery$variables;
|
||||
response: DashboardListsQuery$data;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "count"
|
||||
},
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "first"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "after",
|
||||
"variableName": "first"
|
||||
},
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "filter",
|
||||
"value": {
|
||||
"canEdit": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "first",
|
||||
"variableName": "count"
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "DashboardListsQuery",
|
||||
"selections": [
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "DashboardQueryLists"
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "DashboardListsQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"concreteType": "RoomConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "rooms",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "RoomEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Room",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "debug",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "HashCheckerConfig",
|
||||
"kind": "LinkedField",
|
||||
"name": "hashCheckerConfig",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "chatNotice",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hashCheckMode",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "PageInfo",
|
||||
"kind": "LinkedField",
|
||||
"name": "pageInfo",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasNextPage",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v1/*: any*/),
|
||||
"filters": [
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "DashboardQueryLists_rooms",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "rooms"
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "b6da4b1264fa9efe9070df587fc5396a",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DashboardListsQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query DashboardListsQuery(\n $count: Int\n $first: String\n) {\n ...DashboardQueryLists\n}\n\nfragment DashboardQueryLists on Query {\n rooms(after: $first, first: $count, filter: {canEdit: true}) {\n edges {\n node {\n id\n active\n debug\n hashCheckerConfig {\n chatNotice\n hashCheckMode\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "56aca4bdff70334e5602099f0fe53156";
|
||||
|
||||
export default node;
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @generated SignedSource<<3feb62450a4128509da1c04742d02894>>
|
||||
* @generated SignedSource<<3a1cacd9d1f9fc8ae498211b0141af63>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
@ -9,13 +9,18 @@
|
|||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime';
|
||||
export type DashboardQuery$variables = {};
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DashboardQuery$variables = {
|
||||
first?: string | null;
|
||||
count?: number | null;
|
||||
};
|
||||
export type DashboardQuery$data = {
|
||||
readonly self: {
|
||||
readonly username: string;
|
||||
readonly id: string;
|
||||
readonly admin: boolean | null;
|
||||
} | null;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"DashboardQueryLists">;
|
||||
};
|
||||
export type DashboardQuery = {
|
||||
variables: DashboardQuery$variables;
|
||||
|
@ -23,68 +28,234 @@ export type DashboardQuery = {
|
|||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
var v0 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "count"
|
||||
},
|
||||
v1 = {
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "first"
|
||||
},
|
||||
v2 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "User",
|
||||
"kind": "LinkedField",
|
||||
"name": "self",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "username",
|
||||
"storageKey": null
|
||||
},
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "admin",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
v4 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "User",
|
||||
"kind": "LinkedField",
|
||||
"name": "self",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "username",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "admin",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
"kind": "Variable",
|
||||
"name": "after",
|
||||
"variableName": "first"
|
||||
},
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "filter",
|
||||
"value": {
|
||||
"canEdit": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "first",
|
||||
"variableName": "count"
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [],
|
||||
"argumentDefinitions": [
|
||||
(v0/*: any*/),
|
||||
(v1/*: any*/)
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "DashboardQuery",
|
||||
"selections": (v0/*: any*/),
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"args": null,
|
||||
"kind": "FragmentSpread",
|
||||
"name": "DashboardQueryLists"
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [],
|
||||
"argumentDefinitions": [
|
||||
(v1/*: any*/),
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "DashboardQuery",
|
||||
"selections": (v0/*: any*/)
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v4/*: any*/),
|
||||
"concreteType": "RoomConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "rooms",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "RoomEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Room",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v2/*: any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "debug",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "HashCheckerConfig",
|
||||
"kind": "LinkedField",
|
||||
"name": "hashCheckerConfig",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "chatNotice",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hashCheckMode",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "PageInfo",
|
||||
"kind": "LinkedField",
|
||||
"name": "pageInfo",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasNextPage",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v4/*: any*/),
|
||||
"filters": [
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "DashboardQueryLists_rooms",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "rooms"
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "30b35581f559634650cb5670a9d33fef",
|
||||
"cacheID": "f41a91749c22f4e9026e9ae1d21e72a9",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "DashboardQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query DashboardQuery {\n self {\n username\n id\n admin\n }\n}\n"
|
||||
"text": "query DashboardQuery(\n $first: String\n $count: Int\n) {\n self {\n username\n id\n admin\n }\n ...DashboardQueryLists\n}\n\nfragment DashboardQueryLists on Query {\n rooms(after: $first, first: $count, filter: {canEdit: true}) {\n edges {\n node {\n id\n active\n debug\n hashCheckerConfig {\n chatNotice\n hashCheckMode\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "e57a6cbc8db2ebac74f44dc969f1f0dc";
|
||||
(node as any).hash = "dc06e10a331a27f1a5904147ae650a71";
|
||||
|
||||
export default node;
|
||||
|
|
209
webui/src/components/dashboard/__generated__/DashboardQueryLists.graphql.ts
generated
Normal file
209
webui/src/components/dashboard/__generated__/DashboardQueryLists.graphql.ts
generated
Normal file
|
@ -0,0 +1,209 @@
|
|||
/**
|
||||
* @generated SignedSource<<4b6e4870f3f95cad6fceb76ce82c2ca8>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment, RefetchableFragment } from 'relay-runtime';
|
||||
export type HashCheckerMode = "NOTICE" | "DELETE" | "MUTE" | "BAN" | "%future added value";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type DashboardQueryLists$data = {
|
||||
readonly rooms: {
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
readonly id: string;
|
||||
readonly active: boolean;
|
||||
readonly debug: boolean;
|
||||
readonly hashCheckerConfig: {
|
||||
readonly chatNotice: boolean;
|
||||
readonly hashCheckMode: HashCheckerMode;
|
||||
};
|
||||
};
|
||||
}>;
|
||||
} | null;
|
||||
readonly " $fragmentType": "DashboardQueryLists";
|
||||
};
|
||||
export type DashboardQueryLists$key = {
|
||||
readonly " $data"?: DashboardQueryLists$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"DashboardQueryLists">;
|
||||
};
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
"rooms"
|
||||
];
|
||||
return {
|
||||
"argumentDefinitions": [
|
||||
{
|
||||
"kind": "RootArgument",
|
||||
"name": "count"
|
||||
},
|
||||
{
|
||||
"kind": "RootArgument",
|
||||
"name": "first"
|
||||
}
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": {
|
||||
"connection": [
|
||||
{
|
||||
"count": "count",
|
||||
"cursor": "first",
|
||||
"direction": "forward",
|
||||
"path": (v0/*: any*/)
|
||||
}
|
||||
],
|
||||
"refetch": {
|
||||
"connection": {
|
||||
"forward": {
|
||||
"count": "count",
|
||||
"cursor": "first"
|
||||
},
|
||||
"backward": null,
|
||||
"path": (v0/*: any*/)
|
||||
},
|
||||
"fragmentPathInResult": [],
|
||||
"operation": require('./DashboardListsQuery.graphql')
|
||||
}
|
||||
},
|
||||
"name": "DashboardQueryLists",
|
||||
"selections": [
|
||||
{
|
||||
"alias": "rooms",
|
||||
"args": [
|
||||
{
|
||||
"kind": "Literal",
|
||||
"name": "filter",
|
||||
"value": {
|
||||
"canEdit": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"concreteType": "RoomConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__DashboardQueryLists_rooms_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "RoomEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Room",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "debug",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "HashCheckerConfig",
|
||||
"kind": "LinkedField",
|
||||
"name": "hashCheckerConfig",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "chatNotice",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hashCheckMode",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "__typename",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "cursor",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "PageInfo",
|
||||
"kind": "LinkedField",
|
||||
"name": "pageInfo",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "endCursor",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hasNextPage",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": "__DashboardQueryLists_rooms_connection(filter:{\"canEdit\":true})"
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "56aca4bdff70334e5602099f0fe53156";
|
||||
|
||||
export default node;
|
Loading…
Add table
Reference in a new issue