Reduce requested tracker data in queries
This commit is contained in:
54
src/lib/graphql/fragments/TrackFragments.ts
Normal file
54
src/lib/graphql/fragments/TrackFragments.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { TRACK_RECORD_BIND_FIELDS } from '@/lib/graphql/fragments/TrackRecordFragments.ts';
|
||||
|
||||
export const TRACKER_BASE_FIELDS = gql`
|
||||
fragment TRACKER_BASE_FIELDS on TrackerType {
|
||||
id
|
||||
name
|
||||
icon
|
||||
isLoggedIn
|
||||
isTokenExpired
|
||||
}
|
||||
`;
|
||||
|
||||
export const TRACKER_SETTING_FIELDS = gql`
|
||||
${TRACKER_BASE_FIELDS}
|
||||
|
||||
fragment TRACKER_SETTING_FIELDS on TrackerType {
|
||||
...TRACKER_BASE_FIELDS
|
||||
|
||||
authUrl
|
||||
}
|
||||
`;
|
||||
|
||||
export const TRACKER_BIND_FIELDS = gql`
|
||||
${TRACKER_BASE_FIELDS}
|
||||
${TRACK_RECORD_BIND_FIELDS}
|
||||
|
||||
fragment TRACKER_BIND_FIELDS on TrackerType {
|
||||
...TRACKER_BASE_FIELDS
|
||||
|
||||
icon
|
||||
|
||||
supportsTrackDeletion
|
||||
scores
|
||||
statuses {
|
||||
name
|
||||
value
|
||||
}
|
||||
|
||||
trackRecords {
|
||||
nodes {
|
||||
...TRACK_RECORD_BIND_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
40
src/lib/graphql/fragments/TrackRecordFragments.ts
Normal file
40
src/lib/graphql/fragments/TrackRecordFragments.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const TRACK_RECORD_SEARCH_FIELDS = gql`
|
||||
fragment TRACK_RECORD_SEARCH_FIELDS on TrackSearchType {
|
||||
id
|
||||
remoteId
|
||||
title
|
||||
trackingUrl
|
||||
coverUrl
|
||||
publishingType
|
||||
startDate
|
||||
publishingStatus
|
||||
summary
|
||||
}
|
||||
`;
|
||||
|
||||
export const TRACK_RECORD_BIND_FIELDS = gql`
|
||||
fragment TRACK_RECORD_BIND_FIELDS on TrackRecordType {
|
||||
id
|
||||
remoteId
|
||||
trackerId
|
||||
remoteUrl
|
||||
title
|
||||
status
|
||||
lastChapterRead
|
||||
totalChapters
|
||||
score
|
||||
displayScore
|
||||
startDate
|
||||
finishDate
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user