|
@@ -1,137 +1,134 @@
|
|
import * as Types from './baseTypes.generated'
|
|
import * as Types from './baseTypes.generated'
|
|
|
|
|
|
|
|
+import { DataObjectFieldsFragment, DataObjectFieldsFragmentDoc } from './shared.generated'
|
|
import { BasicChannelFieldsFragment, BasicChannelFieldsFragmentDoc } from './channels.generated'
|
|
import { BasicChannelFieldsFragment, BasicChannelFieldsFragmentDoc } from './channels.generated'
|
|
import { gql } from '@apollo/client'
|
|
import { gql } from '@apollo/client'
|
|
|
|
|
|
import * as Apollo from '@apollo/client'
|
|
import * as Apollo from '@apollo/client'
|
|
-export type VideoMediaFieldsFragment = {
|
|
|
|
- __typename: 'VideoMedia'
|
|
|
|
|
|
+export type VideoMediaMetadataFieldsFragment = {
|
|
|
|
+ __typename?: 'VideoMediaMetadata'
|
|
id: string
|
|
id: string
|
|
- pixelHeight: number
|
|
|
|
- pixelWidth: number
|
|
|
|
- location:
|
|
|
|
- | { __typename: 'JoystreamMediaLocation'; dataObjectId: string }
|
|
|
|
- | { __typename: 'HttpMediaLocation'; url: string }
|
|
|
|
|
|
+ pixelHeight?: Types.Maybe<number>
|
|
|
|
+ pixelWidth?: Types.Maybe<number>
|
|
}
|
|
}
|
|
|
|
|
|
export type LicenseFieldsFragment = {
|
|
export type LicenseFieldsFragment = {
|
|
- __typename: 'LicenseEntity'
|
|
|
|
|
|
+ __typename?: 'License'
|
|
id: string
|
|
id: string
|
|
|
|
+ code?: Types.Maybe<number>
|
|
attribution?: Types.Maybe<string>
|
|
attribution?: Types.Maybe<string>
|
|
- type:
|
|
|
|
- | { __typename: 'UserDefinedLicense'; content: string }
|
|
|
|
- | { __typename: 'KnownLicense'; code: string; url?: Types.Maybe<string> }
|
|
|
|
|
|
+ customText?: Types.Maybe<string>
|
|
}
|
|
}
|
|
|
|
|
|
export type VideoFieldsFragment = {
|
|
export type VideoFieldsFragment = {
|
|
- __typename: 'Video'
|
|
|
|
|
|
+ __typename?: 'Video'
|
|
id: string
|
|
id: string
|
|
- title: string
|
|
|
|
- description: string
|
|
|
|
|
|
+ title?: Types.Maybe<string>
|
|
|
|
+ description?: Types.Maybe<string>
|
|
views?: Types.Maybe<number>
|
|
views?: Types.Maybe<number>
|
|
- duration: number
|
|
|
|
- thumbnailUrl: string
|
|
|
|
|
|
+ duration?: Types.Maybe<number>
|
|
createdAt: Date
|
|
createdAt: Date
|
|
- category: { __typename: 'Category'; id: string }
|
|
|
|
- media: { __typename: 'VideoMedia' } & VideoMediaFieldsFragment
|
|
|
|
- channel: { __typename: 'Channel'; id: string; avatarPhotoUrl?: Types.Maybe<string>; handle: string }
|
|
|
|
- license: { __typename: 'LicenseEntity' } & LicenseFieldsFragment
|
|
|
|
|
|
+ isPublic?: Types.Maybe<boolean>
|
|
|
|
+ isExplicit?: Types.Maybe<boolean>
|
|
|
|
+ isFeatured: boolean
|
|
|
|
+ hasMarketing?: Types.Maybe<boolean>
|
|
|
|
+ isCensored: boolean
|
|
|
|
+ publishedBeforeJoystream?: Types.Maybe<Date>
|
|
|
|
+ mediaUrls: Array<string>
|
|
|
|
+ mediaAvailability: Types.AssetAvailability
|
|
|
|
+ thumbnailPhotoUrls: Array<string>
|
|
|
|
+ thumbnailPhotoAvailability: Types.AssetAvailability
|
|
|
|
+ category?: Types.Maybe<{ __typename?: 'VideoCategory'; id: string }>
|
|
|
|
+ language?: Types.Maybe<{ __typename?: 'Language'; iso: string }>
|
|
|
|
+ mediaMetadata: { __typename?: 'VideoMediaMetadata' } & VideoMediaMetadataFieldsFragment
|
|
|
|
+ mediaDataObject?: Types.Maybe<{ __typename?: 'DataObject' } & DataObjectFieldsFragment>
|
|
|
|
+ thumbnailPhotoDataObject?: Types.Maybe<{ __typename?: 'DataObject' } & DataObjectFieldsFragment>
|
|
|
|
+ channel: { __typename?: 'Channel' } & BasicChannelFieldsFragment
|
|
|
|
+ license?: Types.Maybe<{ __typename?: 'License' } & LicenseFieldsFragment>
|
|
}
|
|
}
|
|
|
|
|
|
export type GetVideoQueryVariables = Types.Exact<{
|
|
export type GetVideoQueryVariables = Types.Exact<{
|
|
- id: Types.Scalars['ID']
|
|
|
|
|
|
+ where: Types.VideoWhereUniqueInput
|
|
}>
|
|
}>
|
|
|
|
|
|
export type GetVideoQuery = {
|
|
export type GetVideoQuery = {
|
|
- __typename: 'Query'
|
|
|
|
- video?: Types.Maybe<
|
|
|
|
- { __typename: 'Video'; channel: { __typename: 'Channel' } & BasicChannelFieldsFragment } & VideoFieldsFragment
|
|
|
|
- >
|
|
|
|
|
|
+ __typename?: 'Query'
|
|
|
|
+ videoByUniqueInput?: Types.Maybe<{ __typename?: 'Video' } & VideoFieldsFragment>
|
|
}
|
|
}
|
|
|
|
|
|
export type GetVideosConnectionQueryVariables = Types.Exact<{
|
|
export type GetVideosConnectionQueryVariables = Types.Exact<{
|
|
first?: Types.Maybe<Types.Scalars['Int']>
|
|
first?: Types.Maybe<Types.Scalars['Int']>
|
|
after?: Types.Maybe<Types.Scalars['String']>
|
|
after?: Types.Maybe<Types.Scalars['String']>
|
|
- categoryId?: Types.Maybe<Types.Scalars['ID']>
|
|
|
|
- channelId?: Types.Maybe<Types.Scalars['ID']>
|
|
|
|
- channelIdIn?: Types.Maybe<Array<Types.Maybe<Types.Scalars['ID']>> | Types.Maybe<Types.Scalars['ID']>>
|
|
|
|
- createdAtGte?: Types.Maybe<Types.Scalars['Date']>
|
|
|
|
orderBy?: Types.Maybe<Types.VideoOrderByInput>
|
|
orderBy?: Types.Maybe<Types.VideoOrderByInput>
|
|
|
|
+ where?: Types.Maybe<Types.VideoWhereInput>
|
|
}>
|
|
}>
|
|
|
|
|
|
export type GetVideosConnectionQuery = {
|
|
export type GetVideosConnectionQuery = {
|
|
- __typename: 'Query'
|
|
|
|
|
|
+ __typename?: 'Query'
|
|
videosConnection: {
|
|
videosConnection: {
|
|
- __typename: 'VideoConnection'
|
|
|
|
|
|
+ __typename?: 'VideoConnection'
|
|
totalCount: number
|
|
totalCount: number
|
|
- edges: Array<{ __typename: 'VideoEdge'; cursor: string; node: { __typename: 'Video' } & VideoFieldsFragment }>
|
|
|
|
- pageInfo: { __typename: 'PageInfo'; hasNextPage: boolean; endCursor?: Types.Maybe<string> }
|
|
|
|
|
|
+ edges: Array<{ __typename?: 'VideoEdge'; cursor: string; node: { __typename?: 'Video' } & VideoFieldsFragment }>
|
|
|
|
+ pageInfo: { __typename?: 'PageInfo'; hasNextPage: boolean; endCursor?: Types.Maybe<string> }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export type GetVideosQueryVariables = Types.Exact<{
|
|
export type GetVideosQueryVariables = Types.Exact<{
|
|
- id_in: Array<Types.Scalars['ID']> | Types.Scalars['ID']
|
|
|
|
|
|
+ offset?: Types.Maybe<Types.Scalars['Int']>
|
|
|
|
+ limit?: Types.Maybe<Types.Scalars['Int']>
|
|
|
|
+ where?: Types.Maybe<Types.VideoWhereInput>
|
|
|
|
+ orderBy?: Types.Maybe<Types.VideoOrderByInput>
|
|
}>
|
|
}>
|
|
|
|
|
|
-export type GetVideosQuery = { __typename: 'Query'; videos: Array<{ __typename: 'Video' } & VideoFieldsFragment> }
|
|
|
|
-
|
|
|
|
-export type GetFeaturedVideosQueryVariables = Types.Exact<{ [key: string]: never }>
|
|
|
|
-
|
|
|
|
-export type GetFeaturedVideosQuery = {
|
|
|
|
- __typename: 'Query'
|
|
|
|
- featuredVideos: Array<{ __typename: 'FeaturedVideo'; video: { __typename: 'Video' } & VideoFieldsFragment }>
|
|
|
|
|
|
+export type GetVideosQuery = {
|
|
|
|
+ __typename?: 'Query'
|
|
|
|
+ videos?: Types.Maybe<Array<{ __typename?: 'Video' } & VideoFieldsFragment>>
|
|
}
|
|
}
|
|
|
|
|
|
export type GetCoverVideoQueryVariables = Types.Exact<{ [key: string]: never }>
|
|
export type GetCoverVideoQueryVariables = Types.Exact<{ [key: string]: never }>
|
|
|
|
|
|
export type GetCoverVideoQuery = {
|
|
export type GetCoverVideoQuery = {
|
|
- __typename: 'Query'
|
|
|
|
|
|
+ __typename?: 'Query'
|
|
coverVideo: {
|
|
coverVideo: {
|
|
- __typename: 'CoverVideo'
|
|
|
|
|
|
+ __typename?: 'CoverVideo'
|
|
coverDescription: string
|
|
coverDescription: string
|
|
- video: { __typename: 'Video' } & VideoFieldsFragment
|
|
|
|
- coverCutMedia: { __typename: 'VideoMedia' } & VideoMediaFieldsFragment
|
|
|
|
|
|
+ video: { __typename?: 'Video' } & VideoFieldsFragment
|
|
|
|
+ coverCutMediaMetadata: { __typename?: 'VideoMediaMetadata' } & VideoMediaMetadataFieldsFragment
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export type GetVideoViewsQueryVariables = Types.Exact<{
|
|
|
|
+ videoId: Types.Scalars['ID']
|
|
|
|
+}>
|
|
|
|
+
|
|
|
|
+export type GetVideoViewsQuery = {
|
|
|
|
+ __typename?: 'Query'
|
|
|
|
+ videoViews?: Types.Maybe<{ __typename?: 'EntityViewsInfo'; id: string; views: number }>
|
|
|
|
+}
|
|
|
|
+
|
|
export type AddVideoViewMutationVariables = Types.Exact<{
|
|
export type AddVideoViewMutationVariables = Types.Exact<{
|
|
videoId: Types.Scalars['ID']
|
|
videoId: Types.Scalars['ID']
|
|
channelId: Types.Scalars['ID']
|
|
channelId: Types.Scalars['ID']
|
|
}>
|
|
}>
|
|
|
|
|
|
export type AddVideoViewMutation = {
|
|
export type AddVideoViewMutation = {
|
|
- __typename: 'Mutation'
|
|
|
|
- addVideoView: { __typename: 'EntityViewsInfo'; id: string; views: number }
|
|
|
|
|
|
+ __typename?: 'Mutation'
|
|
|
|
+ addVideoView: { __typename?: 'EntityViewsInfo'; id: string; views: number }
|
|
}
|
|
}
|
|
|
|
|
|
-export const VideoMediaFieldsFragmentDoc = gql`
|
|
|
|
- fragment VideoMediaFields on VideoMedia {
|
|
|
|
|
|
+export const VideoMediaMetadataFieldsFragmentDoc = gql`
|
|
|
|
+ fragment VideoMediaMetadataFields on VideoMediaMetadata {
|
|
id
|
|
id
|
|
pixelHeight
|
|
pixelHeight
|
|
pixelWidth
|
|
pixelWidth
|
|
- location {
|
|
|
|
- ... on HttpMediaLocation {
|
|
|
|
- url
|
|
|
|
- }
|
|
|
|
- ... on JoystreamMediaLocation {
|
|
|
|
- dataObjectId
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
`
|
|
`
|
|
export const LicenseFieldsFragmentDoc = gql`
|
|
export const LicenseFieldsFragmentDoc = gql`
|
|
- fragment LicenseFields on LicenseEntity {
|
|
|
|
|
|
+ fragment LicenseFields on License {
|
|
id
|
|
id
|
|
|
|
+ code
|
|
attribution
|
|
attribution
|
|
- type {
|
|
|
|
- ... on KnownLicense {
|
|
|
|
- code
|
|
|
|
- url
|
|
|
|
- }
|
|
|
|
- ... on UserDefinedLicense {
|
|
|
|
- content
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ customText
|
|
}
|
|
}
|
|
`
|
|
`
|
|
export const VideoFieldsFragmentDoc = gql`
|
|
export const VideoFieldsFragmentDoc = gql`
|
|
@@ -144,34 +141,48 @@ export const VideoFieldsFragmentDoc = gql`
|
|
}
|
|
}
|
|
views
|
|
views
|
|
duration
|
|
duration
|
|
- thumbnailUrl
|
|
|
|
createdAt
|
|
createdAt
|
|
- media {
|
|
|
|
- ...VideoMediaFields
|
|
|
|
|
|
+ isPublic
|
|
|
|
+ isExplicit
|
|
|
|
+ isFeatured
|
|
|
|
+ hasMarketing
|
|
|
|
+ isCensored
|
|
|
|
+ language {
|
|
|
|
+ iso
|
|
|
|
+ }
|
|
|
|
+ publishedBeforeJoystream
|
|
|
|
+ mediaMetadata {
|
|
|
|
+ ...VideoMediaMetadataFields
|
|
|
|
+ }
|
|
|
|
+ mediaUrls
|
|
|
|
+ mediaAvailability
|
|
|
|
+ mediaDataObject {
|
|
|
|
+ ...DataObjectFields
|
|
|
|
+ }
|
|
|
|
+ thumbnailPhotoUrls
|
|
|
|
+ thumbnailPhotoAvailability
|
|
|
|
+ thumbnailPhotoDataObject {
|
|
|
|
+ ...DataObjectFields
|
|
}
|
|
}
|
|
channel {
|
|
channel {
|
|
- id
|
|
|
|
- avatarPhotoUrl
|
|
|
|
- handle
|
|
|
|
|
|
+ ...BasicChannelFields
|
|
}
|
|
}
|
|
license {
|
|
license {
|
|
...LicenseFields
|
|
...LicenseFields
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ${VideoMediaFieldsFragmentDoc}
|
|
|
|
|
|
+ ${VideoMediaMetadataFieldsFragmentDoc}
|
|
|
|
+ ${DataObjectFieldsFragmentDoc}
|
|
|
|
+ ${BasicChannelFieldsFragmentDoc}
|
|
${LicenseFieldsFragmentDoc}
|
|
${LicenseFieldsFragmentDoc}
|
|
`
|
|
`
|
|
export const GetVideoDocument = gql`
|
|
export const GetVideoDocument = gql`
|
|
- query GetVideo($id: ID!) {
|
|
|
|
- video(where: { id: $id }) {
|
|
|
|
|
|
+ query GetVideo($where: VideoWhereUniqueInput!) {
|
|
|
|
+ videoByUniqueInput(where: $where) {
|
|
...VideoFields
|
|
...VideoFields
|
|
- channel {
|
|
|
|
- ...BasicChannelFields
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${VideoFieldsFragmentDoc}
|
|
${VideoFieldsFragmentDoc}
|
|
- ${BasicChannelFieldsFragmentDoc}
|
|
|
|
`
|
|
`
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -186,7 +197,7 @@ export const GetVideoDocument = gql`
|
|
* @example
|
|
* @example
|
|
* const { data, loading, error } = useGetVideoQuery({
|
|
* const { data, loading, error } = useGetVideoQuery({
|
|
* variables: {
|
|
* variables: {
|
|
- * id: // value for 'id'
|
|
|
|
|
|
+ * where: // value for 'where'
|
|
* },
|
|
* },
|
|
* });
|
|
* });
|
|
*/
|
|
*/
|
|
@@ -203,24 +214,10 @@ export const GetVideosConnectionDocument = gql`
|
|
query GetVideosConnection(
|
|
query GetVideosConnection(
|
|
$first: Int
|
|
$first: Int
|
|
$after: String
|
|
$after: String
|
|
- $categoryId: ID
|
|
|
|
- $channelId: ID
|
|
|
|
- $channelIdIn: [ID]
|
|
|
|
- $createdAtGte: Date
|
|
|
|
$orderBy: VideoOrderByInput = createdAt_DESC
|
|
$orderBy: VideoOrderByInput = createdAt_DESC
|
|
|
|
+ $where: VideoWhereInput
|
|
) {
|
|
) {
|
|
- videosConnection(
|
|
|
|
- first: $first
|
|
|
|
- after: $after
|
|
|
|
- where: {
|
|
|
|
- categoryId_eq: $categoryId
|
|
|
|
- channelId_eq: $channelId
|
|
|
|
- isCurated_eq: false
|
|
|
|
- channelId_in: $channelIdIn
|
|
|
|
- createdAt_gte: $createdAtGte
|
|
|
|
- }
|
|
|
|
- orderBy: $orderBy
|
|
|
|
- ) {
|
|
|
|
|
|
+ videosConnection(first: $first, after: $after, where: $where, orderBy: $orderBy) {
|
|
edges {
|
|
edges {
|
|
cursor
|
|
cursor
|
|
node {
|
|
node {
|
|
@@ -251,11 +248,8 @@ export const GetVideosConnectionDocument = gql`
|
|
* variables: {
|
|
* variables: {
|
|
* first: // value for 'first'
|
|
* first: // value for 'first'
|
|
* after: // value for 'after'
|
|
* after: // value for 'after'
|
|
- * categoryId: // value for 'categoryId'
|
|
|
|
- * channelId: // value for 'channelId'
|
|
|
|
- * channelIdIn: // value for 'channelIdIn'
|
|
|
|
- * createdAtGte: // value for 'createdAtGte'
|
|
|
|
* orderBy: // value for 'orderBy'
|
|
* orderBy: // value for 'orderBy'
|
|
|
|
+ * where: // value for 'where'
|
|
* },
|
|
* },
|
|
* });
|
|
* });
|
|
*/
|
|
*/
|
|
@@ -282,8 +276,8 @@ export type GetVideosConnectionQueryResult = Apollo.QueryResult<
|
|
GetVideosConnectionQueryVariables
|
|
GetVideosConnectionQueryVariables
|
|
>
|
|
>
|
|
export const GetVideosDocument = gql`
|
|
export const GetVideosDocument = gql`
|
|
- query GetVideos($id_in: [ID!]!) {
|
|
|
|
- videos(where: { id_in: $id_in }) {
|
|
|
|
|
|
+ query GetVideos($offset: Int, $limit: Int, $where: VideoWhereInput, $orderBy: VideoOrderByInput = createdAt_DESC) {
|
|
|
|
+ videos(offset: $offset, limit: $limit, where: $where, orderBy: $orderBy) {
|
|
...VideoFields
|
|
...VideoFields
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -302,11 +296,14 @@ export const GetVideosDocument = gql`
|
|
* @example
|
|
* @example
|
|
* const { data, loading, error } = useGetVideosQuery({
|
|
* const { data, loading, error } = useGetVideosQuery({
|
|
* variables: {
|
|
* variables: {
|
|
- * id_in: // value for 'id_in'
|
|
|
|
|
|
+ * offset: // value for 'offset'
|
|
|
|
+ * limit: // value for 'limit'
|
|
|
|
+ * where: // value for 'where'
|
|
|
|
+ * orderBy: // value for 'orderBy'
|
|
* },
|
|
* },
|
|
* });
|
|
* });
|
|
*/
|
|
*/
|
|
-export function useGetVideosQuery(baseOptions: Apollo.QueryHookOptions<GetVideosQuery, GetVideosQueryVariables>) {
|
|
|
|
|
|
+export function useGetVideosQuery(baseOptions?: Apollo.QueryHookOptions<GetVideosQuery, GetVideosQueryVariables>) {
|
|
return Apollo.useQuery<GetVideosQuery, GetVideosQueryVariables>(GetVideosDocument, baseOptions)
|
|
return Apollo.useQuery<GetVideosQuery, GetVideosQueryVariables>(GetVideosDocument, baseOptions)
|
|
}
|
|
}
|
|
export function useGetVideosLazyQuery(
|
|
export function useGetVideosLazyQuery(
|
|
@@ -317,95 +314,88 @@ export function useGetVideosLazyQuery(
|
|
export type GetVideosQueryHookResult = ReturnType<typeof useGetVideosQuery>
|
|
export type GetVideosQueryHookResult = ReturnType<typeof useGetVideosQuery>
|
|
export type GetVideosLazyQueryHookResult = ReturnType<typeof useGetVideosLazyQuery>
|
|
export type GetVideosLazyQueryHookResult = ReturnType<typeof useGetVideosLazyQuery>
|
|
export type GetVideosQueryResult = Apollo.QueryResult<GetVideosQuery, GetVideosQueryVariables>
|
|
export type GetVideosQueryResult = Apollo.QueryResult<GetVideosQuery, GetVideosQueryVariables>
|
|
-export const GetFeaturedVideosDocument = gql`
|
|
|
|
- query GetFeaturedVideos {
|
|
|
|
- featuredVideos(orderBy: createdAt_DESC) {
|
|
|
|
|
|
+export const GetCoverVideoDocument = gql`
|
|
|
|
+ query GetCoverVideo {
|
|
|
|
+ coverVideo {
|
|
video {
|
|
video {
|
|
...VideoFields
|
|
...VideoFields
|
|
}
|
|
}
|
|
|
|
+ coverDescription
|
|
|
|
+ coverCutMediaMetadata {
|
|
|
|
+ ...VideoMediaMetadataFields
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${VideoFieldsFragmentDoc}
|
|
${VideoFieldsFragmentDoc}
|
|
|
|
+ ${VideoMediaMetadataFieldsFragmentDoc}
|
|
`
|
|
`
|
|
|
|
|
|
/**
|
|
/**
|
|
- * __useGetFeaturedVideosQuery__
|
|
|
|
|
|
+ * __useGetCoverVideoQuery__
|
|
*
|
|
*
|
|
- * To run a query within a React component, call `useGetFeaturedVideosQuery` and pass it any options that fit your needs.
|
|
|
|
- * When your component renders, `useGetFeaturedVideosQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
|
|
|
|
+ * To run a query within a React component, call `useGetCoverVideoQuery` and pass it any options that fit your needs.
|
|
|
|
+ * When your component renders, `useGetCoverVideoQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
* you can use to render your UI.
|
|
* you can use to render your UI.
|
|
*
|
|
*
|
|
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
*
|
|
*
|
|
* @example
|
|
* @example
|
|
- * const { data, loading, error } = useGetFeaturedVideosQuery({
|
|
|
|
|
|
+ * const { data, loading, error } = useGetCoverVideoQuery({
|
|
* variables: {
|
|
* variables: {
|
|
* },
|
|
* },
|
|
* });
|
|
* });
|
|
*/
|
|
*/
|
|
-export function useGetFeaturedVideosQuery(
|
|
|
|
- baseOptions?: Apollo.QueryHookOptions<GetFeaturedVideosQuery, GetFeaturedVideosQueryVariables>
|
|
|
|
|
|
+export function useGetCoverVideoQuery(
|
|
|
|
+ baseOptions?: Apollo.QueryHookOptions<GetCoverVideoQuery, GetCoverVideoQueryVariables>
|
|
) {
|
|
) {
|
|
- return Apollo.useQuery<GetFeaturedVideosQuery, GetFeaturedVideosQueryVariables>(
|
|
|
|
- GetFeaturedVideosDocument,
|
|
|
|
- baseOptions
|
|
|
|
- )
|
|
|
|
|
|
+ return Apollo.useQuery<GetCoverVideoQuery, GetCoverVideoQueryVariables>(GetCoverVideoDocument, baseOptions)
|
|
}
|
|
}
|
|
-export function useGetFeaturedVideosLazyQuery(
|
|
|
|
- baseOptions?: Apollo.LazyQueryHookOptions<GetFeaturedVideosQuery, GetFeaturedVideosQueryVariables>
|
|
|
|
|
|
+export function useGetCoverVideoLazyQuery(
|
|
|
|
+ baseOptions?: Apollo.LazyQueryHookOptions<GetCoverVideoQuery, GetCoverVideoQueryVariables>
|
|
) {
|
|
) {
|
|
- return Apollo.useLazyQuery<GetFeaturedVideosQuery, GetFeaturedVideosQueryVariables>(
|
|
|
|
- GetFeaturedVideosDocument,
|
|
|
|
- baseOptions
|
|
|
|
- )
|
|
|
|
|
|
+ return Apollo.useLazyQuery<GetCoverVideoQuery, GetCoverVideoQueryVariables>(GetCoverVideoDocument, baseOptions)
|
|
}
|
|
}
|
|
-export type GetFeaturedVideosQueryHookResult = ReturnType<typeof useGetFeaturedVideosQuery>
|
|
|
|
-export type GetFeaturedVideosLazyQueryHookResult = ReturnType<typeof useGetFeaturedVideosLazyQuery>
|
|
|
|
-export type GetFeaturedVideosQueryResult = Apollo.QueryResult<GetFeaturedVideosQuery, GetFeaturedVideosQueryVariables>
|
|
|
|
-export const GetCoverVideoDocument = gql`
|
|
|
|
- query GetCoverVideo {
|
|
|
|
- coverVideo {
|
|
|
|
- video {
|
|
|
|
- ...VideoFields
|
|
|
|
- }
|
|
|
|
- coverDescription
|
|
|
|
- coverCutMedia {
|
|
|
|
- ...VideoMediaFields
|
|
|
|
- }
|
|
|
|
|
|
+export type GetCoverVideoQueryHookResult = ReturnType<typeof useGetCoverVideoQuery>
|
|
|
|
+export type GetCoverVideoLazyQueryHookResult = ReturnType<typeof useGetCoverVideoLazyQuery>
|
|
|
|
+export type GetCoverVideoQueryResult = Apollo.QueryResult<GetCoverVideoQuery, GetCoverVideoQueryVariables>
|
|
|
|
+export const GetVideoViewsDocument = gql`
|
|
|
|
+ query GetVideoViews($videoId: ID!) {
|
|
|
|
+ videoViews(videoId: $videoId) {
|
|
|
|
+ id
|
|
|
|
+ views
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ${VideoFieldsFragmentDoc}
|
|
|
|
- ${VideoMediaFieldsFragmentDoc}
|
|
|
|
`
|
|
`
|
|
|
|
|
|
/**
|
|
/**
|
|
- * __useGetCoverVideoQuery__
|
|
|
|
|
|
+ * __useGetVideoViewsQuery__
|
|
*
|
|
*
|
|
- * To run a query within a React component, call `useGetCoverVideoQuery` and pass it any options that fit your needs.
|
|
|
|
- * When your component renders, `useGetCoverVideoQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
|
|
|
|
+ * To run a query within a React component, call `useGetVideoViewsQuery` and pass it any options that fit your needs.
|
|
|
|
+ * When your component renders, `useGetVideoViewsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
* you can use to render your UI.
|
|
* you can use to render your UI.
|
|
*
|
|
*
|
|
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
*
|
|
*
|
|
* @example
|
|
* @example
|
|
- * const { data, loading, error } = useGetCoverVideoQuery({
|
|
|
|
|
|
+ * const { data, loading, error } = useGetVideoViewsQuery({
|
|
* variables: {
|
|
* variables: {
|
|
|
|
+ * videoId: // value for 'videoId'
|
|
* },
|
|
* },
|
|
* });
|
|
* });
|
|
*/
|
|
*/
|
|
-export function useGetCoverVideoQuery(
|
|
|
|
- baseOptions?: Apollo.QueryHookOptions<GetCoverVideoQuery, GetCoverVideoQueryVariables>
|
|
|
|
|
|
+export function useGetVideoViewsQuery(
|
|
|
|
+ baseOptions: Apollo.QueryHookOptions<GetVideoViewsQuery, GetVideoViewsQueryVariables>
|
|
) {
|
|
) {
|
|
- return Apollo.useQuery<GetCoverVideoQuery, GetCoverVideoQueryVariables>(GetCoverVideoDocument, baseOptions)
|
|
|
|
|
|
+ return Apollo.useQuery<GetVideoViewsQuery, GetVideoViewsQueryVariables>(GetVideoViewsDocument, baseOptions)
|
|
}
|
|
}
|
|
-export function useGetCoverVideoLazyQuery(
|
|
|
|
- baseOptions?: Apollo.LazyQueryHookOptions<GetCoverVideoQuery, GetCoverVideoQueryVariables>
|
|
|
|
|
|
+export function useGetVideoViewsLazyQuery(
|
|
|
|
+ baseOptions?: Apollo.LazyQueryHookOptions<GetVideoViewsQuery, GetVideoViewsQueryVariables>
|
|
) {
|
|
) {
|
|
- return Apollo.useLazyQuery<GetCoverVideoQuery, GetCoverVideoQueryVariables>(GetCoverVideoDocument, baseOptions)
|
|
|
|
|
|
+ return Apollo.useLazyQuery<GetVideoViewsQuery, GetVideoViewsQueryVariables>(GetVideoViewsDocument, baseOptions)
|
|
}
|
|
}
|
|
-export type GetCoverVideoQueryHookResult = ReturnType<typeof useGetCoverVideoQuery>
|
|
|
|
-export type GetCoverVideoLazyQueryHookResult = ReturnType<typeof useGetCoverVideoLazyQuery>
|
|
|
|
-export type GetCoverVideoQueryResult = Apollo.QueryResult<GetCoverVideoQuery, GetCoverVideoQueryVariables>
|
|
|
|
|
|
+export type GetVideoViewsQueryHookResult = ReturnType<typeof useGetVideoViewsQuery>
|
|
|
|
+export type GetVideoViewsLazyQueryHookResult = ReturnType<typeof useGetVideoViewsLazyQuery>
|
|
|
|
+export type GetVideoViewsQueryResult = Apollo.QueryResult<GetVideoViewsQuery, GetVideoViewsQueryVariables>
|
|
export const AddVideoViewDocument = gql`
|
|
export const AddVideoViewDocument = gql`
|
|
mutation AddVideoView($videoId: ID!, $channelId: ID!) {
|
|
mutation AddVideoView($videoId: ID!, $channelId: ID!) {
|
|
addVideoView(videoId: $videoId, channelId: $channelId) {
|
|
addVideoView(videoId: $videoId, channelId: $channelId) {
|