Skip to content

Commit

Permalink
Overhaul graphql client cache invalidation (#3912)
Browse files Browse the repository at this point in the history
* Update apollo client
* Overhaul graphql client cache invalidation
* Fix tagger studio link display update
* Add graphql formatting
  • Loading branch information
DingDongSoLong4 authored Jul 28, 2023
1 parent a1da626 commit 7b77b89
Show file tree
Hide file tree
Showing 64 changed files with 2,977 additions and 1,882 deletions.
2 changes: 1 addition & 1 deletion graphql/documents/data/config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fragment ConfigDefaultSettingsData on ConfigDefaultSettingsResult {
scanGenerateThumbnails
scanGenerateClipPreviews
}

identify {
sources {
source {
Expand Down
2 changes: 1 addition & 1 deletion graphql/documents/data/filter.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ fragment SavedFilterData on SavedFilter {
mode
name
filter
}
}
2 changes: 1 addition & 1 deletion graphql/documents/data/gallery-slim.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fragment SlimGalleryData on Gallery {
files {
...ImageFileData
}

paths {
thumbnail
}
Expand Down
2 changes: 1 addition & 1 deletion graphql/documents/data/image.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fragment ImageData on Image {
studio {
...SlimStudioData
}

tags {
...SlimTagData
}
Expand Down
2 changes: 1 addition & 1 deletion graphql/documents/data/job.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ fragment JobData on Job {
startTime
endTime
addTime
}
}
2 changes: 1 addition & 1 deletion graphql/documents/data/movie.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fragment MovieData on Movie {
studio {
...SlimStudioData
}

synopsis
url
front_image_path
Expand Down
2 changes: 1 addition & 1 deletion graphql/documents/data/scene.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fragment SceneData on Scene {
studio {
...SlimStudioData
}

movies {
movie {
...MovieData
Expand Down
2 changes: 1 addition & 1 deletion graphql/documents/mutations/file.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mutation DeleteFiles($ids: [ID!]!) {
deleteFiles(ids: $ids)
}
}
2 changes: 1 addition & 1 deletion graphql/documents/mutations/filter.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mutation SaveFilter($input: SaveFilterInput!) {
saveFilter(input: $input) {
...SavedFilterData
}
}
}

mutation DestroySavedFilter($input: DestroyFilterInput!) {
destroySavedFilter(input: $input)
Expand Down
38 changes: 20 additions & 18 deletions graphql/documents/mutations/gallery-chapter.graphql
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
mutation GalleryChapterCreate(
$title: String!,
$image_index: Int!,
$gallery_id: ID!) {
galleryChapterCreate(input: {
title: $title,
image_index: $image_index,
gallery_id: $gallery_id,
}) {
$title: String!
$image_index: Int!
$gallery_id: ID!
) {
galleryChapterCreate(
input: { title: $title, image_index: $image_index, gallery_id: $gallery_id }
) {
...GalleryChapterData
}
}

mutation GalleryChapterUpdate(
$id: ID!,
$title: String!,
$image_index: Int!,
$gallery_id: ID!) {
galleryChapterUpdate(input: {
id: $id,
title: $title,
image_index: $image_index,
gallery_id: $gallery_id,
}) {
$id: ID!
$title: String!
$image_index: Int!
$gallery_id: ID!
) {
galleryChapterUpdate(
input: {
id: $id
title: $title
image_index: $image_index
gallery_id: $gallery_id
}
) {
...GalleryChapterData
}
}
Expand Down
38 changes: 21 additions & 17 deletions graphql/documents/mutations/gallery.graphql
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
mutation GalleryCreate(
$input: GalleryCreateInput!) {

mutation GalleryCreate($input: GalleryCreateInput!) {
galleryCreate(input: $input) {
...GalleryData
...GalleryData
}
}

mutation GalleryUpdate(
$input: GalleryUpdateInput!) {

mutation GalleryUpdate($input: GalleryUpdateInput!) {
galleryUpdate(input: $input) {
...GalleryData
...GalleryData
}
}

mutation BulkGalleryUpdate(
$input: BulkGalleryUpdateInput!) {

mutation BulkGalleryUpdate($input: BulkGalleryUpdateInput!) {
bulkGalleryUpdate(input: $input) {
...GalleryData
...GalleryData
}
}

mutation GalleriesUpdate($input : [GalleryUpdateInput!]!) {
mutation GalleriesUpdate($input: [GalleryUpdateInput!]!) {
galleriesUpdate(input: $input) {
...GalleryData
}
}

mutation GalleryDestroy($ids: [ID!]!, $delete_file: Boolean, $delete_generated : Boolean) {
galleryDestroy(input: {ids: $ids, delete_file: $delete_file, delete_generated: $delete_generated})
mutation GalleryDestroy(
$ids: [ID!]!
$delete_file: Boolean
$delete_generated: Boolean
) {
galleryDestroy(
input: {
ids: $ids
delete_file: $delete_file
delete_generated: $delete_generated
}
)
}

mutation AddGalleryImages($gallery_id: ID!, $image_ids: [ID!]!) {
addGalleryImages(input: {gallery_id: $gallery_id, image_ids: $image_ids})
addGalleryImages(input: { gallery_id: $gallery_id, image_ids: $image_ids })
}

mutation RemoveGalleryImages($gallery_id: ID!, $image_ids: [ID!]!) {
removeGalleryImages(input: {gallery_id: $gallery_id, image_ids: $image_ids})
removeGalleryImages(input: { gallery_id: $gallery_id, image_ids: $image_ids })
}
48 changes: 32 additions & 16 deletions graphql/documents/mutations/image.graphql
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
mutation ImageUpdate(
$input: ImageUpdateInput!) {

mutation ImageUpdate($input: ImageUpdateInput!) {
imageUpdate(input: $input) {
...SlimImageData
...SlimImageData
}
}

mutation BulkImageUpdate(
$input: BulkImageUpdateInput!) {

mutation BulkImageUpdate($input: BulkImageUpdateInput!) {
bulkImageUpdate(input: $input) {
...SlimImageData
...SlimImageData
}
}

mutation ImagesUpdate($input : [ImageUpdateInput!]!) {
mutation ImagesUpdate($input: [ImageUpdateInput!]!) {
imagesUpdate(input: $input) {
...SlimImageData
}
}

mutation ImageIncrementO($id: ID!) {
imageIncrementO(id: $id)
imageIncrementO(id: $id)
}

mutation ImageDecrementO($id: ID!) {
Expand All @@ -32,10 +28,30 @@ mutation ImageResetO($id: ID!) {
imageResetO(id: $id)
}

mutation ImageDestroy($id: ID!, $delete_file: Boolean, $delete_generated : Boolean) {
imageDestroy(input: {id: $id, delete_file: $delete_file, delete_generated: $delete_generated})
}

mutation ImagesDestroy($ids: [ID!]!, $delete_file: Boolean, $delete_generated : Boolean) {
imagesDestroy(input: {ids: $ids, delete_file: $delete_file, delete_generated: $delete_generated})
mutation ImageDestroy(
$id: ID!
$delete_file: Boolean
$delete_generated: Boolean
) {
imageDestroy(
input: {
id: $id
delete_file: $delete_file
delete_generated: $delete_generated
}
)
}

mutation ImagesDestroy(
$ids: [ID!]!
$delete_file: Boolean
$delete_generated: Boolean
) {
imagesDestroy(
input: {
ids: $ids
delete_file: $delete_file
delete_generated: $delete_generated
}
)
}
4 changes: 2 additions & 2 deletions graphql/documents/mutations/job.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ mutation StopJob($job_id: ID!) {
}

mutation StopAllJobs {
stopAllJobs
}
stopAllJobs
}
2 changes: 1 addition & 1 deletion graphql/documents/mutations/migration.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ mutation MigrateSceneScreenshots($input: MigrateSceneScreenshotsInput!) {

mutation MigrateBlobs($input: MigrateBlobsInput!) {
migrateBlobs(input: $input)
}
}
14 changes: 4 additions & 10 deletions graphql/documents/mutations/performer.graphql
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
mutation PerformerCreate(
$input: PerformerCreateInput!) {

mutation PerformerCreate($input: PerformerCreateInput!) {
performerCreate(input: $input) {
...PerformerData
...PerformerData
}
}

mutation PerformerUpdate(
$input: PerformerUpdateInput!) {

mutation PerformerUpdate($input: PerformerUpdateInput!) {
performerUpdate(input: $input) {
...PerformerData
}
}

mutation BulkPerformerUpdate(
$input: BulkPerformerUpdateInput!) {

mutation BulkPerformerUpdate($input: BulkPerformerUpdateInput!) {
bulkPerformerUpdate(input: $input) {
...PerformerData
}
Expand Down
6 changes: 5 additions & 1 deletion graphql/documents/mutations/plugins.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ mutation ReloadPlugins {
reloadPlugins
}

mutation RunPluginTask($plugin_id: ID!, $task_name: String!, $args: [PluginArgInput!]) {
mutation RunPluginTask(
$plugin_id: ID!
$task_name: String!
$args: [PluginArgInput!]
) {
runPluginTask(plugin_id: $plugin_id, task_name: $task_name, args: $args)
}
62 changes: 33 additions & 29 deletions graphql/documents/mutations/scene-marker.graphql
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
mutation SceneMarkerCreate(
$title: String!,
$seconds: Float!,
$scene_id: ID!,
$primary_tag_id: ID!,
$tag_ids: [ID!] = []) {

sceneMarkerCreate(input: {
title: $title,
seconds: $seconds,
scene_id: $scene_id,
primary_tag_id: $primary_tag_id,
tag_ids: $tag_ids
}) {
$title: String!
$seconds: Float!
$scene_id: ID!
$primary_tag_id: ID!
$tag_ids: [ID!] = []
) {
sceneMarkerCreate(
input: {
title: $title
seconds: $seconds
scene_id: $scene_id
primary_tag_id: $primary_tag_id
tag_ids: $tag_ids
}
) {
...SceneMarkerData
}
}

mutation SceneMarkerUpdate(
$id: ID!,
$title: String!,
$seconds: Float!,
$scene_id: ID!,
$primary_tag_id: ID!,
$tag_ids: [ID!] = []) {

sceneMarkerUpdate(input: {
id: $id,
title: $title,
seconds: $seconds,
scene_id: $scene_id,
primary_tag_id: $primary_tag_id,
tag_ids: $tag_ids
}) {
$id: ID!
$title: String!
$seconds: Float!
$scene_id: ID!
$primary_tag_id: ID!
$tag_ids: [ID!] = []
) {
sceneMarkerUpdate(
input: {
id: $id
title: $title
seconds: $seconds
scene_id: $scene_id
primary_tag_id: $primary_tag_id
tag_ids: $tag_ids
}
) {
...SceneMarkerData
}
}

mutation SceneMarkerDestroy($id: ID!) {
sceneMarkerDestroy(id: $id)
}
}
Loading

0 comments on commit 7b77b89

Please sign in to comment.