Skip to content

Commit 9a13474

Browse files
committed
refactor: reorder GraphQL fields
1 parent 49b1c0a commit 9a13474

37 files changed

Lines changed: 332 additions & 332 deletions

File tree

app/(admin)/(activity-management)/events/[id]/_components/query.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export const EVENT_BY_ID_QUERY = graphql(`
44
query EventById($id: ID!) {
55
event(id: $id) {
66
id
7+
payload
8+
triggeredAt
9+
type
710
user {
811
id
912
name
1013
}
11-
type
12-
payload
13-
triggeredAt
1414
}
1515
}
1616
`);

app/(admin)/(activity-management)/events/_components/query.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ import { graphql } from "@/gql";
22

33
export const EVENTS_TABLE_QUERY = graphql(`
44
query EventsTable(
5-
$first: Int
65
$after: Cursor
7-
$last: Int
86
$before: Cursor
7+
$first: Int
8+
$last: Int
99
$where: EventWhereInput
1010
) {
11-
events(first: $first, after: $after, last: $last, before: $before, where: $where, orderBy: { field: TRIGGERED_AT, direction: DESC }) {
11+
events(after: $after, before: $before, first: $first, last: $last, orderBy: { field: TRIGGERED_AT, direction: DESC }, where: $where) {
12+
totalCount
1213
edges {
1314
node {
1415
id
16+
triggeredAt
17+
type
1518
user {
1619
id
1720
name
1821
}
19-
type
20-
triggeredAt
2122
}
2223
}
23-
totalCount
2424
pageInfo {
25+
endCursor
2526
hasNextPage
2627
hasPreviousPage
27-
endCursor
2828
startCursor
2929
}
3030
}

app/(admin)/(activity-management)/points/[id]/_components/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const POINT_HEADER_QUERY = graphql(`
88
query PointHeader($id: ID!) {
99
pointGrant(id: $id) {
1010
id
11-
points
1211
grantedAt
12+
points
1313
}
1414
}
1515
`);

app/(admin)/(activity-management)/points/[id]/_components/point-cards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { UserCard } from "./user-card";
88
const POINT_CARDS_QUERY = graphql(`
99
query PointCards($id: ID!) {
1010
pointGrant(id: $id) {
11-
id
1211
...PointDetailsCard
1312
...PointUserCard
13+
id
1414
}
1515
}
1616
`);

app/(admin)/(activity-management)/points/[id]/_components/point-details-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { type FragmentType, graphql, useFragment } from "@/gql";
66
const POINT_DETAILS_CARD_FRAGMENT = graphql(`
77
fragment PointDetailsCard on Point {
88
id
9-
points
109
description
1110
grantedAt
11+
points
1212
}
1313
`);
1414

app/(admin)/(activity-management)/points/_components/data-table.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ import { columns, type Point } from "./data-table-columns";
1010

1111
export const POINTS_TABLE_QUERY = graphql(`
1212
query PointsTable(
13-
$first: Int
1413
$after: Cursor
15-
$last: Int
1614
$before: Cursor
15+
$first: Int
16+
$last: Int
1717
$where: PointWhereInput
1818
) {
1919
points(
20-
first: $first
2120
after: $after
22-
last: $last
2321
before: $before
24-
where: $where
22+
first: $first
23+
last: $last
2524
orderBy: { field: GRANTED_AT, direction: DESC }
25+
where: $where
2626
) {
27+
totalCount
2728
edges {
2829
node {
29-
id
3030
...PointsTableRow
31+
id
3132
}
3233
}
33-
totalCount
3434
pageInfo {
35-
hasNextPage
3635
endCursor
36+
hasNextPage
3737
}
3838
}
3939
}
@@ -42,13 +42,13 @@ export const POINTS_TABLE_QUERY = graphql(`
4242
const POINTS_TABLE_ROW_FRAGMENT = graphql(`
4343
fragment PointsTableRow on Point {
4444
id
45+
description
46+
grantedAt
47+
points
4548
user {
4649
id
4750
name
4851
}
49-
points
50-
description
51-
grantedAt
5252
}
5353
`);
5454

app/(admin)/(activity-management)/points/_components/update-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const UPDATE_POINTS_FORM_USER_INFO_QUERY = graphql(`
3131
query UpdatePointsFormUserInfo($id: ID!) {
3232
user(id: $id) {
3333
id
34-
name
3534
email
35+
name
3636
}
3737
}
3838
`);

app/(admin)/(activity-management)/submissions/[id]/_components/result-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const SUBMISSION_RESULT_CARD_FRAGMENT = graphql(`
1212
id
1313
queryResult {
1414
columns
15-
rows
1615
matchAnswer
16+
rows
1717
}
1818
question {
1919
id

app/(admin)/(activity-management)/submissions/[id]/_components/submission-cards.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { UserCard } from "./user-card";
99
const SUBMISSION_CARDS_QUERY = graphql(`
1010
query SubmissionCards($id: ID!) {
1111
submission(id: $id) {
12-
id
1312
...SubmissionDetailsCard
14-
...SubmissionUserCard
1513
...SubmissionResultCard
14+
...SubmissionUserCard
15+
id
1616
}
1717
}
1818
`);

app/(admin)/(activity-management)/submissions/[id]/_components/submission-details-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { type FragmentType, graphql, useFragment } from "@/gql";
66
const SUBMISSION_DETAILS_CARD_FRAGMENT = graphql(`
77
fragment SubmissionDetailsCard on Submission {
88
id
9-
submittedCode
109
error
10+
submittedCode
1111
}
1212
`);
1313

0 commit comments

Comments
 (0)