-
-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
- Loading branch information
1 parent
32c91c4
commit 7e8f941
Showing
58 changed files
with
1,685 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
fragment GalleryChapterData on GalleryChapter { | ||
id | ||
title | ||
image_index | ||
|
||
gallery { | ||
id | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
mutation GalleryChapterCreate( | ||
$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, | ||
}) { | ||
...GalleryChapterData | ||
} | ||
} | ||
|
||
mutation GalleryChapterDestroy($id: ID!) { | ||
galleryChapterDestroy(id: $id) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
type GalleryChapter { | ||
id: ID! | ||
gallery: Gallery! | ||
title: String! | ||
image_index: Int! | ||
created_at: Time! | ||
updated_at: Time! | ||
} | ||
|
||
input GalleryChapterCreateInput { | ||
gallery_id: ID! | ||
title: String! | ||
image_index: Int! | ||
} | ||
|
||
input GalleryChapterUpdateInput { | ||
id: ID! | ||
gallery_id: ID! | ||
title: String! | ||
image_index: Int! | ||
} | ||
|
||
type FindGalleryChaptersResultType { | ||
count: Int! | ||
chapters: [GalleryChapter!]! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/stashapp/stash/pkg/models" | ||
) | ||
|
||
func (r *galleryChapterResolver) Gallery(ctx context.Context, obj *models.GalleryChapter) (ret *models.Gallery, err error) { | ||
if !obj.GalleryID.Valid { | ||
panic("Invalid gallery id") | ||
} | ||
|
||
if err := r.withReadTxn(ctx, func(ctx context.Context) error { | ||
galleryID := int(obj.GalleryID.Int64) | ||
ret, err = r.repository.Gallery.Find(ctx, galleryID) | ||
return err | ||
}); err != nil { | ||
return nil, err | ||
} | ||
|
||
return ret, nil | ||
} | ||
|
||
func (r *galleryChapterResolver) CreatedAt(ctx context.Context, obj *models.GalleryChapter) (*time.Time, error) { | ||
return &obj.CreatedAt.Timestamp, nil | ||
} | ||
|
||
func (r *galleryChapterResolver) UpdatedAt(ctx context.Context, obj *models.GalleryChapter) (*time.Time, error) { | ||
return &obj.UpdatedAt.Timestamp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.