traxxx/assets/js/fragments.js

310 lines
5.1 KiB
JavaScript
Raw Normal View History

const siteFragment = `
entity {
id
name
slug
url
type
independent
parent {
id
name
slug
url
type
independent
}
}
`;
2020-01-02 23:59:02 +00:00
const sitesFragment = `
entities {
2020-01-02 23:59:02 +00:00
id
name
slug
url
type
independent
parent {
2020-01-02 23:59:02 +00:00
id
name
slug
url
type
independent
2020-01-02 23:59:02 +00:00
}
}
`;
2020-03-09 04:06:37 +00:00
const actorFields = `
id
name
slug
2020-05-15 02:40:59 +00:00
birthdate: dateOfBirth
age
2020-01-25 01:29:49 +00:00
gender
avatar: avatarMedia {
id
path
thumbnail
lazy
2020-05-25 00:02:28 +00:00
sfw: sfwMedia {
id
path
thumbnail
lazy
}
}
network: entity {
id
name
slug
}
birthCountry: countryByBirthCountryAlpha2 {
alpha2
name
alias
}
2020-03-09 04:06:37 +00:00
`;
const releaseActorsFragment = `
actors: releasesActors(orderBy: ACTOR_BY_ACTOR_ID__GENDER_ASC) {
actor {
${actorFields}
}
}
`;
const releaseTagsFragment = `
tags: releasesTags(orderBy: TAG_BY_TAG_ID__PRIORITY_DESC) {
tag {
name
priority
slug
id
}
}
`;
const releasePosterFragment = `
poster: releasesPosterByReleaseId {
media {
index
path
thumbnail
lazy
comment
sfw: sfwMedia {
id
thumbnail
lazy
path
comment
}
}
}
`;
const releaseCoversFragment = `
covers: releasesCovers {
media {
index
path
thumbnail
lazy
comment
sfw: sfwMedia {
id
thumbnail
lazy
path
comment
}
}
}
`;
const releasePhotosFragment = `
photos: releasesPhotos {
media {
index
path
thumbnail
lazy
comment
sfw: sfwMedia {
id
thumbnail
lazy
path
comment
}
}
}
`;
const releaseTrailerFragment = `
trailer: releasesTrailerByReleaseId {
media {
index
path
thumbnail
mime
}
}
`;
const releaseTeaserFragment = `
teaser: releasesTeaserByReleaseId {
media {
index
path
thumbnail
mime
}
}
`;
const releaseFields = `
id
title
date
datePrecision
slug
type
shootId
productionDate
createdAt
url
${releaseActorsFragment}
${releaseTagsFragment}
${releasePosterFragment}
${releaseCoversFragment}
${siteFragment}
studio {
id
name
slug
url
}
isNew
`;
const releasesFragment = `
2020-05-22 02:32:16 +00:00
connection: releasesConnection(
2019-12-18 01:42:55 +00:00
filter: {
date: {
lessThan: $before,
greaterThan: $after,
}
2020-05-22 02:32:16 +00:00
releasesTagsConnection: {
2020-01-30 22:41:10 +00:00
none: {
tag: {
slug: {
in: $exclude
}
}
}
}
2019-12-18 01:42:55 +00:00
},
first: $limit,
2020-05-22 02:32:16 +00:00
offset: $offset,
orderBy: $orderBy,
2019-12-18 01:42:55 +00:00
) {
2020-05-22 02:32:16 +00:00
releases: nodes {
${releaseFields}
movieActors: movieActorsByMovieId(orderBy: ACTOR_BY_ACTOR_ID__GENDER_ASC) {
actor {
${actorFields}
}
}
movieTags: movieTagsByMovieId(orderBy: TAG_BY_TAG_ID__PRIORITY_DESC) {
tag {
id
name
slug
}
}
}
totalCount
2019-12-18 01:42:55 +00:00
}
`;
const releaseFragment = `
release(id: $releaseId) {
id
title
description
date
datePrecision
duration
createdAt
shootId
productionDate
url
${releaseActorsFragment}
${releaseTagsFragment}
${releasePosterFragment}
${releasePhotosFragment}
${releaseCoversFragment}
${releaseTrailerFragment}
${releaseTeaserFragment}
${siteFragment}
2020-03-09 04:06:37 +00:00
movieActors: movieActorsByMovieId(orderBy: ACTOR_BY_ACTOR_ID__GENDER_ASC) {
actor {
${actorFields}
}
}
movieTags: movieTagsByMovieId(orderBy: TAG_BY_TAG_ID__PRIORITY_DESC) {
tag {
id
name
slug
}
}
2020-03-09 04:06:37 +00:00
movies: releasesMoviesBySceneId {
movie {
id
title
date
slug
createdAt
url
${releaseCoversFragment}
${siteFragment}
actors: movieActorsByMovieId {
actor {
id
name
slug
}
}
}
}
scenes: releasesMoviesByMovieId {
scene {
${releaseFields}
}
}
studio {
id
name
slug
url
}
}
`;
export {
releaseActorsFragment,
releaseFields,
releaseTagsFragment,
releasePosterFragment,
releasePhotosFragment,
releaseTrailerFragment,
releasesFragment,
releaseFragment,
siteFragment,
sitesFragment,
};