core/panel/graphql/queries.ts

243 lines
3.9 KiB
TypeScript
Raw Normal View History

2025-06-30 18:25:26 +00:00
import { gql } from 'graphql-tag'
// Определяем GraphQL запрос
export const ADMIN_GET_SHOUTS_QUERY: string =
gql`
query AdminGetShouts($limit: Int, $offset: Int, $search: String, $status: String) {
adminGetShouts(limit: $limit, offset: $offset, search: $search, status: $status) {
shouts {
id
title
slug
body
lead
subtitle
layout
lang
cover
cover_caption
media {
url
2025-06-30 19:43:32 +00:00
title
2025-06-30 18:25:26 +00:00
body
2025-06-30 19:43:32 +00:00
source
pic
2025-06-30 18:25:26 +00:00
}
seo
created_at
updated_at
published_at
featured_at
deleted_at
created_by {
id
2025-06-30 19:19:46 +00:00
name
2025-06-30 18:25:26 +00:00
email
2025-06-30 19:19:46 +00:00
slug
}
updated_by {
id
2025-06-30 18:25:26 +00:00
name
2025-06-30 19:19:46 +00:00
email
slug
}
deleted_by {
id
name
email
slug
}
community {
id
name
slug
2025-06-30 18:25:26 +00:00
}
authors {
id
name
email
2025-06-30 19:19:46 +00:00
slug
2025-06-30 18:25:26 +00:00
}
topics {
id
title
slug
}
2025-06-30 19:19:46 +00:00
version_of
draft
2025-06-30 18:25:26 +00:00
stat {
rating
comments_count
viewed
2025-06-30 19:19:46 +00:00
last_commented_at
2025-06-30 18:25:26 +00:00
}
}
total
page
perPage
totalPages
}
}
`.loc?.source.body || ''
export const ADMIN_GET_USERS_QUERY: string =
gql`
query AdminGetUsers($limit: Int, $offset: Int, $search: String) {
adminGetUsers(limit: $limit, offset: $offset, search: $search) {
authors {
id
email
name
slug
roles
created_at
last_seen
}
total
page
perPage
totalPages
}
}
`.loc?.source.body || ''
export const ADMIN_GET_ROLES_QUERY: string =
gql`
query AdminGetRoles {
adminGetRoles {
id
name
description
}
}
`.loc?.source.body || ''
export const ADMIN_GET_ENV_VARIABLES_QUERY: string =
gql`
query GetEnvVariables {
getEnvVariables {
name
description
variables {
key
value
description
type
isSecret
}
}
}
`.loc?.source.body || ''
export const GET_COMMUNITIES_QUERY: string =
gql`
query GetCommunities {
get_communities_all {
2025-06-30 19:43:32 +00:00
id
slug
name
desc
pic
created_at
created_by {
2025-06-30 18:25:26 +00:00
id
name
2025-06-30 19:43:32 +00:00
email
slug
}
stat {
shouts
followers
authors
2025-06-30 18:25:26 +00:00
}
}
}
`.loc?.source.body || ''
export const GET_TOPICS_QUERY: string =
gql`
query GetTopics {
get_topics_all {
2025-06-30 19:43:32 +00:00
id
slug
title
body
pic
community
parent_ids
stat {
shouts
followers
authors
comments
2025-06-30 18:25:26 +00:00
}
2025-06-30 19:43:32 +00:00
oid
is_main
2025-06-30 18:25:26 +00:00
}
}
`.loc?.source.body || ''
2025-06-30 18:46:53 +00:00
export const GET_COLLECTIONS_QUERY: string =
gql`
query GetCollections {
get_collections_all {
2025-06-30 19:43:32 +00:00
id
slug
title
desc
pic
amount
published_at
created_at
created_by {
2025-06-30 18:46:53 +00:00
id
2025-06-30 19:43:32 +00:00
name
email
2025-06-30 19:19:46 +00:00
slug
}
}
}
`.loc?.source.body || ''
export const ADMIN_GET_INVITES_QUERY: string =
gql`
query AdminGetInvites($limit: Int, $offset: Int, $search: String, $status: String) {
adminGetInvites(limit: $limit, offset: $offset, search: $search, status: $status) {
invites {
inviter_id
author_id
shout_id
status
inviter {
id
name
email
slug
}
author {
id
name
email
slug
}
shout {
id
title
slug
created_by {
id
name
email
slug
}
}
created_at
2025-06-30 18:46:53 +00:00
}
2025-06-30 19:19:46 +00:00
total
page
perPage
totalPages
2025-06-30 18:46:53 +00:00
}
}
`.loc?.source.body || ''