added documentaries test for shema events in tinacms and edit contet
This commit is contained in:
parent
bcac9d79ab
commit
a24dc384e9
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
locale: es
|
||||||
|
title: test
|
||||||
|
---
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["news"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"News":{"type":"News","resolveType":"collectionDocument","collection":"news","createNews":"create","updateNews":"update"},"NewsConnection":{"type":"NewsConnection","resolveType":"collectionDocumentList","collection":"news"}}
|
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["news","documentaries"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"News":{"type":"News","resolveType":"collectionDocument","collection":"news","createNews":"create","updateNews":"update"},"NewsConnection":{"type":"NewsConnection","resolveType":"collectionDocumentList","collection":"news"},"Documentaries":{"type":"Documentaries","resolveType":"collectionDocument","collection":"documentaries","createDocumentaries":"create","updateDocumentaries":"update"},"DocumentariesConnection":{"type":"DocumentariesConnection","resolveType":"collectionDocumentList","collection":"documentaries"}}
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":{"fullVersion":"2.2.3","major":"2","minor":"2","patch":"3"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"news","label":"News","path":"src/content/news","format":"md","fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"}],"namespace":["news","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["news","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["news","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["news","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["news","place"],"searchable":true,"uid":false},{"type":"string","name":"thumbnail","label":"Thumbnail URL","namespace":["news","thumbnail"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["news","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["news","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["news","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["news"]}],"config":{"media":{"tina":{"publicFolder":"public","mediaRoot":"public/images"}}}}
|
{"version":{"fullVersion":"2.2.3","major":"2","minor":"2","patch":"3"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"news","label":"News","path":"src/content/news","format":"md","fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"}],"namespace":["news","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["news","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["news","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["news","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["news","place"],"searchable":true,"uid":false},{"type":"string","name":"thumbnail","label":"Thumbnail URL","namespace":["news","thumbnail"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["news","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["news","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["news","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["news"]},{"name":"documentaries","label":"Documentaries","path":"src/content/documentaries","format":"md","fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"}],"namespace":["documentaries","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["documentaries","title"],"searchable":true,"uid":false},{"type":"string","name":"video_yt","label":"YouTube ID","namespace":["documentaries","video_yt"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["documentaries","date"],"searchable":true,"uid":false}],"namespace":["documentaries"]}],"config":{"media":{"tina":{"publicFolder":"public","mediaRoot":"public/images"}}}}
|
||||||
|
|
@ -77,6 +77,40 @@ var config_default = defineConfig({
|
||||||
isBody: true
|
isBody: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "documentaries",
|
||||||
|
label: "Documentaries",
|
||||||
|
path: "src/content/documentaries",
|
||||||
|
format: "md",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "locale",
|
||||||
|
label: "Language",
|
||||||
|
options: [
|
||||||
|
{ label: "Espa\xF1ol", value: "es" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "title",
|
||||||
|
label: "Title",
|
||||||
|
isTitle: true,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "video_yt",
|
||||||
|
label: "YouTube ID"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "datetime",
|
||||||
|
name: "date",
|
||||||
|
label: "Date",
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,11 @@ fragment NewsParts on News {
|
||||||
draft
|
draft
|
||||||
body
|
body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fragment DocumentariesParts on Documentaries {
|
||||||
|
__typename
|
||||||
|
locale
|
||||||
|
title
|
||||||
|
video_yt
|
||||||
|
date
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,3 +52,58 @@ query newsConnection($before: String, $after: String, $first: Float, $last: Floa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query documentaries($relativePath: String!) {
|
||||||
|
documentaries(relativePath: $relativePath) {
|
||||||
|
... on Document {
|
||||||
|
_sys {
|
||||||
|
filename
|
||||||
|
basename
|
||||||
|
hasReferences
|
||||||
|
breadcrumbs
|
||||||
|
path
|
||||||
|
relativePath
|
||||||
|
extension
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
...DocumentariesParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) {
|
||||||
|
documentariesConnection(
|
||||||
|
before: $before
|
||||||
|
after: $after
|
||||||
|
first: $first
|
||||||
|
last: $last
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
pageInfo {
|
||||||
|
hasPreviousPage
|
||||||
|
hasNextPage
|
||||||
|
startCursor
|
||||||
|
endCursor
|
||||||
|
}
|
||||||
|
totalCount
|
||||||
|
edges {
|
||||||
|
cursor
|
||||||
|
node {
|
||||||
|
... on Document {
|
||||||
|
_sys {
|
||||||
|
filename
|
||||||
|
basename
|
||||||
|
hasReferences
|
||||||
|
breadcrumbs
|
||||||
|
path
|
||||||
|
relativePath
|
||||||
|
extension
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
...DocumentariesParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,13 @@ type Query {
|
||||||
document(collection: String, relativePath: String): DocumentNode!
|
document(collection: String, relativePath: String): DocumentNode!
|
||||||
news(relativePath: String): News!
|
news(relativePath: String): News!
|
||||||
newsConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: NewsFilter): NewsConnection!
|
newsConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: NewsFilter): NewsConnection!
|
||||||
|
documentaries(relativePath: String): Documentaries!
|
||||||
|
documentariesConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentariesFilter): DocumentariesConnection!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentFilter {
|
input DocumentFilter {
|
||||||
news: NewsFilter
|
news: NewsFilter
|
||||||
|
documentaries: DocumentariesFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
type DocumentConnectionEdges {
|
type DocumentConnectionEdges {
|
||||||
|
|
@ -85,7 +88,7 @@ type Collection {
|
||||||
documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection!
|
documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection!
|
||||||
}
|
}
|
||||||
|
|
||||||
union DocumentNode = News | Folder
|
union DocumentNode = News | Documentaries | Folder
|
||||||
|
|
||||||
type News implements Node & Document {
|
type News implements Node & Document {
|
||||||
locale: String
|
locale: String
|
||||||
|
|
@ -151,6 +154,34 @@ type NewsConnection implements Connection {
|
||||||
edges: [NewsConnectionEdges]
|
edges: [NewsConnectionEdges]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Documentaries implements Node & Document {
|
||||||
|
locale: String
|
||||||
|
title: String!
|
||||||
|
video_yt: String
|
||||||
|
date: String!
|
||||||
|
id: ID!
|
||||||
|
_sys: SystemInfo!
|
||||||
|
_values: JSON!
|
||||||
|
}
|
||||||
|
|
||||||
|
input DocumentariesFilter {
|
||||||
|
locale: StringFilter
|
||||||
|
title: StringFilter
|
||||||
|
video_yt: StringFilter
|
||||||
|
date: DatetimeFilter
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocumentariesConnectionEdges {
|
||||||
|
cursor: String!
|
||||||
|
node: Documentaries
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocumentariesConnection implements Connection {
|
||||||
|
pageInfo: PageInfo!
|
||||||
|
totalCount: Float!
|
||||||
|
edges: [DocumentariesConnectionEdges]
|
||||||
|
}
|
||||||
|
|
||||||
type Mutation {
|
type Mutation {
|
||||||
addPendingDocument(collection: String!, relativePath: String!, template: String): DocumentNode!
|
addPendingDocument(collection: String!, relativePath: String!, template: String): DocumentNode!
|
||||||
updateDocument(collection: String, relativePath: String!, params: DocumentUpdateMutation!): DocumentNode!
|
updateDocument(collection: String, relativePath: String!, params: DocumentUpdateMutation!): DocumentNode!
|
||||||
|
|
@ -159,15 +190,19 @@ type Mutation {
|
||||||
createFolder(collection: String, relativePath: String!): DocumentNode!
|
createFolder(collection: String, relativePath: String!): DocumentNode!
|
||||||
updateNews(relativePath: String!, params: NewsMutation!): News!
|
updateNews(relativePath: String!, params: NewsMutation!): News!
|
||||||
createNews(relativePath: String!, params: NewsMutation!): News!
|
createNews(relativePath: String!, params: NewsMutation!): News!
|
||||||
|
updateDocumentaries(relativePath: String!, params: DocumentariesMutation!): Documentaries!
|
||||||
|
createDocumentaries(relativePath: String!, params: DocumentariesMutation!): Documentaries!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentUpdateMutation {
|
input DocumentUpdateMutation {
|
||||||
news: NewsMutation
|
news: NewsMutation
|
||||||
|
documentaries: DocumentariesMutation
|
||||||
relativePath: String
|
relativePath: String
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentMutation {
|
input DocumentMutation {
|
||||||
news: NewsMutation
|
news: NewsMutation
|
||||||
|
documentaries: DocumentariesMutation
|
||||||
}
|
}
|
||||||
|
|
||||||
input NewsMutation {
|
input NewsMutation {
|
||||||
|
|
@ -182,6 +217,13 @@ input NewsMutation {
|
||||||
body: JSON
|
body: JSON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input DocumentariesMutation {
|
||||||
|
locale: String
|
||||||
|
title: String
|
||||||
|
video_yt: String
|
||||||
|
date: String
|
||||||
|
}
|
||||||
|
|
||||||
schema {
|
schema {
|
||||||
query: Query
|
query: Query
|
||||||
mutation: Mutation
|
mutation: Mutation
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@ export type Query = {
|
||||||
document: DocumentNode;
|
document: DocumentNode;
|
||||||
news: News;
|
news: News;
|
||||||
newsConnection: NewsConnection;
|
newsConnection: NewsConnection;
|
||||||
|
documentaries: Documentaries;
|
||||||
|
documentariesConnection: DocumentariesConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -122,8 +124,24 @@ export type QueryNewsConnectionArgs = {
|
||||||
filter?: InputMaybe<NewsFilter>;
|
filter?: InputMaybe<NewsFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type QueryDocumentariesArgs = {
|
||||||
|
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type QueryDocumentariesConnectionArgs = {
|
||||||
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
first?: InputMaybe<Scalars['Float']['input']>;
|
||||||
|
last?: InputMaybe<Scalars['Float']['input']>;
|
||||||
|
sort?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
filter?: InputMaybe<DocumentariesFilter>;
|
||||||
|
};
|
||||||
|
|
||||||
export type DocumentFilter = {
|
export type DocumentFilter = {
|
||||||
news?: InputMaybe<NewsFilter>;
|
news?: InputMaybe<NewsFilter>;
|
||||||
|
documentaries?: InputMaybe<DocumentariesFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentConnectionEdges = {
|
export type DocumentConnectionEdges = {
|
||||||
|
|
@ -163,7 +181,7 @@ export type CollectionDocumentsArgs = {
|
||||||
folder?: InputMaybe<Scalars['String']['input']>;
|
folder?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentNode = News | Folder;
|
export type DocumentNode = News | Documentaries | Folder;
|
||||||
|
|
||||||
export type News = Node & Document & {
|
export type News = Node & Document & {
|
||||||
__typename?: 'News';
|
__typename?: 'News';
|
||||||
|
|
@ -232,6 +250,37 @@ export type NewsConnection = Connection & {
|
||||||
edges?: Maybe<Array<Maybe<NewsConnectionEdges>>>;
|
edges?: Maybe<Array<Maybe<NewsConnectionEdges>>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type Documentaries = Node & Document & {
|
||||||
|
__typename?: 'Documentaries';
|
||||||
|
locale?: Maybe<Scalars['String']['output']>;
|
||||||
|
title: Scalars['String']['output'];
|
||||||
|
video_yt?: Maybe<Scalars['String']['output']>;
|
||||||
|
date: Scalars['String']['output'];
|
||||||
|
id: Scalars['ID']['output'];
|
||||||
|
_sys: SystemInfo;
|
||||||
|
_values: Scalars['JSON']['output'];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DocumentariesFilter = {
|
||||||
|
locale?: InputMaybe<StringFilter>;
|
||||||
|
title?: InputMaybe<StringFilter>;
|
||||||
|
video_yt?: InputMaybe<StringFilter>;
|
||||||
|
date?: InputMaybe<DatetimeFilter>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DocumentariesConnectionEdges = {
|
||||||
|
__typename?: 'DocumentariesConnectionEdges';
|
||||||
|
cursor: Scalars['String']['output'];
|
||||||
|
node?: Maybe<Documentaries>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DocumentariesConnection = Connection & {
|
||||||
|
__typename?: 'DocumentariesConnection';
|
||||||
|
pageInfo: PageInfo;
|
||||||
|
totalCount: Scalars['Float']['output'];
|
||||||
|
edges?: Maybe<Array<Maybe<DocumentariesConnectionEdges>>>;
|
||||||
|
};
|
||||||
|
|
||||||
export type Mutation = {
|
export type Mutation = {
|
||||||
__typename?: 'Mutation';
|
__typename?: 'Mutation';
|
||||||
addPendingDocument: DocumentNode;
|
addPendingDocument: DocumentNode;
|
||||||
|
|
@ -241,6 +290,8 @@ export type Mutation = {
|
||||||
createFolder: DocumentNode;
|
createFolder: DocumentNode;
|
||||||
updateNews: News;
|
updateNews: News;
|
||||||
createNews: News;
|
createNews: News;
|
||||||
|
updateDocumentaries: Documentaries;
|
||||||
|
createDocumentaries: Documentaries;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -288,13 +339,27 @@ export type MutationCreateNewsArgs = {
|
||||||
params: NewsMutation;
|
params: NewsMutation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type MutationUpdateDocumentariesArgs = {
|
||||||
|
relativePath: Scalars['String']['input'];
|
||||||
|
params: DocumentariesMutation;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type MutationCreateDocumentariesArgs = {
|
||||||
|
relativePath: Scalars['String']['input'];
|
||||||
|
params: DocumentariesMutation;
|
||||||
|
};
|
||||||
|
|
||||||
export type DocumentUpdateMutation = {
|
export type DocumentUpdateMutation = {
|
||||||
news?: InputMaybe<NewsMutation>;
|
news?: InputMaybe<NewsMutation>;
|
||||||
|
documentaries?: InputMaybe<DocumentariesMutation>;
|
||||||
relativePath?: InputMaybe<Scalars['String']['input']>;
|
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentMutation = {
|
export type DocumentMutation = {
|
||||||
news?: InputMaybe<NewsMutation>;
|
news?: InputMaybe<NewsMutation>;
|
||||||
|
documentaries?: InputMaybe<DocumentariesMutation>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type NewsMutation = {
|
export type NewsMutation = {
|
||||||
|
|
@ -309,8 +374,17 @@ export type NewsMutation = {
|
||||||
body?: InputMaybe<Scalars['JSON']['input']>;
|
body?: InputMaybe<Scalars['JSON']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type DocumentariesMutation = {
|
||||||
|
locale?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
title?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
video_yt?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
date?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
};
|
||||||
|
|
||||||
export type NewsPartsFragment = { __typename: 'News', locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, thumbnail?: string | null, youtube?: string | null, draft?: boolean | null, body?: any | null };
|
export type NewsPartsFragment = { __typename: 'News', locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, thumbnail?: string | null, youtube?: string | null, draft?: boolean | null, body?: any | null };
|
||||||
|
|
||||||
|
export type DocumentariesPartsFragment = { __typename: 'Documentaries', locale?: string | null, title: string, video_yt?: string | null, date: string };
|
||||||
|
|
||||||
export type NewsQueryVariables = Exact<{
|
export type NewsQueryVariables = Exact<{
|
||||||
relativePath: Scalars['String']['input'];
|
relativePath: Scalars['String']['input'];
|
||||||
}>;
|
}>;
|
||||||
|
|
@ -330,6 +404,25 @@ export type NewsConnectionQueryVariables = Exact<{
|
||||||
|
|
||||||
export type NewsConnectionQuery = { __typename?: 'Query', newsConnection: { __typename?: 'NewsConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'NewsConnectionEdges', cursor: string, node?: { __typename: 'News', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, thumbnail?: string | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } };
|
export type NewsConnectionQuery = { __typename?: 'Query', newsConnection: { __typename?: 'NewsConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'NewsConnectionEdges', cursor: string, node?: { __typename: 'News', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, thumbnail?: string | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } };
|
||||||
|
|
||||||
|
export type DocumentariesQueryVariables = Exact<{
|
||||||
|
relativePath: Scalars['String']['input'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type DocumentariesQuery = { __typename?: 'Query', documentaries: { __typename: 'Documentaries', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } };
|
||||||
|
|
||||||
|
export type DocumentariesConnectionQueryVariables = Exact<{
|
||||||
|
before?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
first?: InputMaybe<Scalars['Float']['input']>;
|
||||||
|
last?: InputMaybe<Scalars['Float']['input']>;
|
||||||
|
sort?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
filter?: InputMaybe<DocumentariesFilter>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type DocumentariesConnectionQuery = { __typename?: 'Query', documentariesConnection: { __typename?: 'DocumentariesConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'DocumentariesConnectionEdges', cursor: string, node?: { __typename: 'Documentaries', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } };
|
||||||
|
|
||||||
export const NewsPartsFragmentDoc = gql`
|
export const NewsPartsFragmentDoc = gql`
|
||||||
fragment NewsParts on News {
|
fragment NewsParts on News {
|
||||||
__typename
|
__typename
|
||||||
|
|
@ -344,6 +437,15 @@ export const NewsPartsFragmentDoc = gql`
|
||||||
body
|
body
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
export const DocumentariesPartsFragmentDoc = gql`
|
||||||
|
fragment DocumentariesParts on Documentaries {
|
||||||
|
__typename
|
||||||
|
locale
|
||||||
|
title
|
||||||
|
video_yt
|
||||||
|
date
|
||||||
|
}
|
||||||
|
`;
|
||||||
export const NewsDocument = gql`
|
export const NewsDocument = gql`
|
||||||
query news($relativePath: String!) {
|
query news($relativePath: String!) {
|
||||||
news(relativePath: $relativePath) {
|
news(relativePath: $relativePath) {
|
||||||
|
|
@ -401,6 +503,63 @@ export const NewsConnectionDocument = gql`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
${NewsPartsFragmentDoc}`;
|
${NewsPartsFragmentDoc}`;
|
||||||
|
export const DocumentariesDocument = gql`
|
||||||
|
query documentaries($relativePath: String!) {
|
||||||
|
documentaries(relativePath: $relativePath) {
|
||||||
|
... on Document {
|
||||||
|
_sys {
|
||||||
|
filename
|
||||||
|
basename
|
||||||
|
hasReferences
|
||||||
|
breadcrumbs
|
||||||
|
path
|
||||||
|
relativePath
|
||||||
|
extension
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
...DocumentariesParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${DocumentariesPartsFragmentDoc}`;
|
||||||
|
export const DocumentariesConnectionDocument = gql`
|
||||||
|
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) {
|
||||||
|
documentariesConnection(
|
||||||
|
before: $before
|
||||||
|
after: $after
|
||||||
|
first: $first
|
||||||
|
last: $last
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
pageInfo {
|
||||||
|
hasPreviousPage
|
||||||
|
hasNextPage
|
||||||
|
startCursor
|
||||||
|
endCursor
|
||||||
|
}
|
||||||
|
totalCount
|
||||||
|
edges {
|
||||||
|
cursor
|
||||||
|
node {
|
||||||
|
... on Document {
|
||||||
|
_sys {
|
||||||
|
filename
|
||||||
|
basename
|
||||||
|
hasReferences
|
||||||
|
breadcrumbs
|
||||||
|
path
|
||||||
|
relativePath
|
||||||
|
extension
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
...DocumentariesParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${DocumentariesPartsFragmentDoc}`;
|
||||||
export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R>
|
export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R>
|
||||||
export function getSdk<C>(requester: Requester<C>) {
|
export function getSdk<C>(requester: Requester<C>) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -409,6 +568,12 @@ export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C)
|
||||||
},
|
},
|
||||||
newsConnection(variables?: NewsConnectionQueryVariables, options?: C): Promise<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}> {
|
newsConnection(variables?: NewsConnectionQueryVariables, options?: C): Promise<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}> {
|
||||||
return requester<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}, NewsConnectionQueryVariables>(NewsConnectionDocument, variables, options);
|
return requester<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}, NewsConnectionQueryVariables>(NewsConnectionDocument, variables, options);
|
||||||
|
},
|
||||||
|
documentaries(variables: DocumentariesQueryVariables, options?: C): Promise<{data: DocumentariesQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesQueryVariables, query: string}> {
|
||||||
|
return requester<{data: DocumentariesQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesQueryVariables, query: string}, DocumentariesQueryVariables>(DocumentariesDocument, variables, options);
|
||||||
|
},
|
||||||
|
documentariesConnection(variables?: DocumentariesConnectionQueryVariables, options?: C): Promise<{data: DocumentariesConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesConnectionQueryVariables, query: string}> {
|
||||||
|
return requester<{data: DocumentariesConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesConnectionQueryVariables, query: string}, DocumentariesConnectionQueryVariables>(DocumentariesConnectionDocument, variables, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,40 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "documentaries",
|
||||||
|
label: "Documentaries",
|
||||||
|
path: "src/content/documentaries",
|
||||||
|
format: "md",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "locale",
|
||||||
|
label: "Language",
|
||||||
|
options: [
|
||||||
|
{ label: "Español", value: "es" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "title",
|
||||||
|
label: "Title",
|
||||||
|
isTitle: true,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "video_yt",
|
||||||
|
label: "YouTube ID",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "datetime",
|
||||||
|
name: "date",
|
||||||
|
label: "Date",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue