mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 05:48:27 +01:00
chore: add TinaCMS generated files and sync schema
Co-Authored-By: G <butaeff@gmail.com>
This commit is contained in:
1 parent
43b62a196d
commit
f7c40b8228
8 files changed
+613
No files matched your search
Generated
+1
@@ -0,0 +1 @@
|
||||
{"kind":"Document","definitions":[{"kind":"ScalarTypeDefinition","name":{"kind":"Name","value":"Reference"},"description":{"kind":"StringValue","value":"References another document, used as a foreign key"},"directives":[]},{"kind":"ScalarTypeDefinition","name":{"kind":"Name","value":"JSON"},"description":{"kind":"StringValue","value":""},"directives":[]},{"kind":"ObjectTypeDefinition","interfaces":[],"directives":[],"name":{"kind":"Name","value":"SystemInfo"},"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"filename"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"title"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"basename"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"breadcrumbs"},"arguments":[{"kind":"InputValueDefinition","name":{"kind":"Name","value":"excludeExtension"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"path"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"relativePath"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"extension"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"template"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"collection"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Collection"}}}}]},{"kind":"ObjectTypeDefinition","interfaces":[],"directives":[],"name":{"kind":"Name","value":"Folder"},"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"path"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}]},{"kind":"ObjectTypeDefinition","interfaces":[],"directives":[],"name":{"kind":"Name","value":"PageInfo"},"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"hasPreviousPage"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"hasNextPage"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"startCursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"endCursor"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}]},{"kind":"InterfaceTypeDefinition","description":{"kind":"StringValue","value":""},"name":{"kind":"Name","value":"Node"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}]},{"kind":"InterfaceTypeDefinition","description":{"kind":"StringValue","value":""},"name":{"kind":"Name","value":"Document"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"_sys"},"arguments":[],"type":{"kind":"NamedType","name":{"kind":"Name","value":"SystemInfo"}}},{"kind":"FieldDefinition","name":{"kind":"Name","value":"_values"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"JSON"}}}}]},{"kind":"InterfaceTypeDefinition","description":{"kind":"StringValue","value":"A relay-compliant pagination connection"},"name":{"kind":"Name","value":"Connection"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","name":{"kind":"Name","value":"totalCount"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind"Line truncated
|
||||
Generated
+1
@@ -0,0 +1 @@
|
||||
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["post"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"Post":{"type":"Post","resolveType":"collectionDocument","collection":"post","createPost":"create","updatePost":"update"},"PostConnection":{"type":"PostConnection","resolveType":"collectionDocumentList","collection":"post"}}
|
||||
Generated
+1
@@ -0,0 +1 @@
|
||||
{"version":{"fullVersion":"1.4.11","major":"1","minor":"4","patch":"11"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"post","label":"Blog Posts","path":"content/posts","format":"mdx","fields":[{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["post","title"]},{"type":"rich-text","name":"body","label":"Body","isBody":true,"namespace":["post","body"],"parser":{"type":"mdx"}}],"namespace":["post"]}],"config":{}}
|
||||
Generated
+5
@@ -0,0 +1,5 @@
|
||||
import { createClient } from "tinacms/dist/client";
|
||||
import { queries } from "./types";
|
||||
export const client = createClient({ url: 'https://content.tinajs.io/1.4/content/c7fe2362-7424-4956-a241-4d246238f406/github/devin/1739369831-add-tina-cms', token: '9de4fe3a4f7ddefcf391fdebc4480d4b0a5b0e20', queries });
|
||||
export default client;
|
||||
|
||||
Generated
+4
@@ -0,0 +1,4 @@
|
||||
fragment PostParts on Post {
|
||||
title
|
||||
body
|
||||
}
|
||||
Generated
+52
@@ -0,0 +1,52 @@
|
||||
query post($relativePath: String!) {
|
||||
post(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
_sys {
|
||||
filename
|
||||
basename
|
||||
breadcrumbs
|
||||
path
|
||||
relativePath
|
||||
extension
|
||||
}
|
||||
id
|
||||
}
|
||||
...PostParts
|
||||
}
|
||||
}
|
||||
|
||||
query postConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: PostFilter) {
|
||||
postConnection(
|
||||
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
|
||||
breadcrumbs
|
||||
path
|
||||
relativePath
|
||||
extension
|
||||
}
|
||||
id
|
||||
}
|
||||
...PostParts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+152
@@ -0,0 +1,152 @@
|
||||
# DO NOT MODIFY THIS FILE. This file is automatically generated by Tina
|
||||
"""References another document, used as a foreign key"""
|
||||
scalar Reference
|
||||
|
||||
""""""
|
||||
scalar JSON
|
||||
|
||||
type SystemInfo {
|
||||
filename: String!
|
||||
title: String
|
||||
basename: String!
|
||||
breadcrumbs(excludeExtension: Boolean): [String!]!
|
||||
path: String!
|
||||
relativePath: String!
|
||||
extension: String!
|
||||
template: String!
|
||||
collection: Collection!
|
||||
}
|
||||
|
||||
type Folder {
|
||||
name: String!
|
||||
path: String!
|
||||
}
|
||||
|
||||
type PageInfo {
|
||||
hasPreviousPage: Boolean!
|
||||
hasNextPage: Boolean!
|
||||
startCursor: String!
|
||||
endCursor: String!
|
||||
}
|
||||
|
||||
""""""
|
||||
interface Node {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
""""""
|
||||
interface Document {
|
||||
id: ID!
|
||||
_sys: SystemInfo
|
||||
_values: JSON!
|
||||
}
|
||||
|
||||
"""A relay-compliant pagination connection"""
|
||||
interface Connection {
|
||||
totalCount: Float!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type Query {
|
||||
getOptimizedQuery(queryString: String!): String
|
||||
collection(collection: String): Collection!
|
||||
collections: [Collection!]!
|
||||
node(id: String): Node!
|
||||
document(collection: String, relativePath: String): DocumentNode!
|
||||
post(relativePath: String): Post!
|
||||
postConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: PostFilter): PostConnection!
|
||||
}
|
||||
|
||||
input DocumentFilter {
|
||||
post: PostFilter
|
||||
}
|
||||
|
||||
type DocumentConnectionEdges {
|
||||
cursor: String!
|
||||
node: DocumentNode
|
||||
}
|
||||
|
||||
type DocumentConnection implements Connection {
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Float!
|
||||
edges: [DocumentConnectionEdges]
|
||||
}
|
||||
|
||||
type Collection {
|
||||
name: String!
|
||||
slug: String!
|
||||
label: String
|
||||
path: String!
|
||||
format: String
|
||||
matches: String
|
||||
templates: [JSON]
|
||||
fields: [JSON]
|
||||
documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection!
|
||||
}
|
||||
|
||||
union DocumentNode = Post | Folder
|
||||
|
||||
type Post implements Node & Document {
|
||||
title: String!
|
||||
body: JSON
|
||||
id: ID!
|
||||
_sys: SystemInfo!
|
||||
_values: JSON!
|
||||
}
|
||||
|
||||
input StringFilter {
|
||||
startsWith: String
|
||||
eq: String
|
||||
exists: Boolean
|
||||
in: [String]
|
||||
}
|
||||
|
||||
input RichTextFilter {
|
||||
startsWith: String
|
||||
eq: String
|
||||
exists: Boolean
|
||||
}
|
||||
|
||||
input PostFilter {
|
||||
title: StringFilter
|
||||
body: RichTextFilter
|
||||
}
|
||||
|
||||
type PostConnectionEdges {
|
||||
cursor: String!
|
||||
node: Post
|
||||
}
|
||||
|
||||
type PostConnection implements Connection {
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Float!
|
||||
edges: [PostConnectionEdges]
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
addPendingDocument(collection: String!, relativePath: String!, template: String): DocumentNode!
|
||||
updateDocument(collection: String, relativePath: String!, params: DocumentUpdateMutation!): DocumentNode!
|
||||
deleteDocument(collection: String, relativePath: String!): DocumentNode!
|
||||
createDocument(collection: String, relativePath: String!, params: DocumentMutation!): DocumentNode!
|
||||
updatePost(relativePath: String!, params: PostMutation!): Post!
|
||||
createPost(relativePath: String!, params: PostMutation!): Post!
|
||||
}
|
||||
|
||||
input DocumentUpdateMutation {
|
||||
post: PostMutation
|
||||
relativePath: String
|
||||
}
|
||||
|
||||
input DocumentMutation {
|
||||
post: PostMutation
|
||||
}
|
||||
|
||||
input PostMutation {
|
||||
title: String
|
||||
body: JSON
|
||||
}
|
||||
|
||||
schema {
|
||||
query: Query
|
||||
mutation: Mutation
|
||||
}
|
||||
Generated
+397
@@ -0,0 +1,397 @@
|
||||
//@ts-nocheck
|
||||
// DO NOT MODIFY THIS FILE. This file is automatically generated by Tina
|
||||
export function gql(strings: TemplateStringsArray, ...args: string[]): string {
|
||||
let str = ''
|
||||
strings.forEach((string, i) => {
|
||||
str += string + (args[i] || '')
|
||||
})
|
||||
return str
|
||||
}
|
||||
export type Maybe<T> = T | null;
|
||||
export type InputMaybe<T> = Maybe<T>;
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: string;
|
||||
String: string;
|
||||
Boolean: boolean;
|
||||
Int: number;
|
||||
Float: number;
|
||||
/** References another document, used as a foreign key */
|
||||
Reference: any;
|
||||
JSON: any;
|
||||
};
|
||||
|
||||
export type SystemInfo = {
|
||||
__typename?: 'SystemInfo';
|
||||
filename: Scalars['String'];
|
||||
title?: Maybe<Scalars['String']>;
|
||||
basename: Scalars['String'];
|
||||
breadcrumbs: Array<Scalars['String']>;
|
||||
path: Scalars['String'];
|
||||
relativePath: Scalars['String'];
|
||||
extension: Scalars['String'];
|
||||
template: Scalars['String'];
|
||||
collection: Collection;
|
||||
};
|
||||
|
||||
|
||||
export type SystemInfoBreadcrumbsArgs = {
|
||||
excludeExtension?: InputMaybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type Folder = {
|
||||
__typename?: 'Folder';
|
||||
name: Scalars['String'];
|
||||
path: Scalars['String'];
|
||||
};
|
||||
|
||||
export type PageInfo = {
|
||||
__typename?: 'PageInfo';
|
||||
hasPreviousPage: Scalars['Boolean'];
|
||||
hasNextPage: Scalars['Boolean'];
|
||||
startCursor: Scalars['String'];
|
||||
endCursor: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Node = {
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
export type Document = {
|
||||
id: Scalars['ID'];
|
||||
_sys?: Maybe<SystemInfo>;
|
||||
_values: Scalars['JSON'];
|
||||
};
|
||||
|
||||
/** A relay-compliant pagination connection */
|
||||
export type Connection = {
|
||||
totalCount: Scalars['Float'];
|
||||
pageInfo: PageInfo;
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
getOptimizedQuery?: Maybe<Scalars['String']>;
|
||||
collection: Collection;
|
||||
collections: Array<Collection>;
|
||||
node: Node;
|
||||
document: DocumentNode;
|
||||
post: Post;
|
||||
postConnection: PostConnection;
|
||||
};
|
||||
|
||||
|
||||
export type QueryGetOptimizedQueryArgs = {
|
||||
queryString: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryCollectionArgs = {
|
||||
collection?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryNodeArgs = {
|
||||
id?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryDocumentArgs = {
|
||||
collection?: InputMaybe<Scalars['String']>;
|
||||
relativePath?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryPostArgs = {
|
||||
relativePath?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryPostConnectionArgs = {
|
||||
before?: InputMaybe<Scalars['String']>;
|
||||
after?: InputMaybe<Scalars['String']>;
|
||||
first?: InputMaybe<Scalars['Float']>;
|
||||
last?: InputMaybe<Scalars['Float']>;
|
||||
sort?: InputMaybe<Scalars['String']>;
|
||||
filter?: InputMaybe<PostFilter>;
|
||||
};
|
||||
|
||||
export type DocumentFilter = {
|
||||
post?: InputMaybe<PostFilter>;
|
||||
};
|
||||
|
||||
export type DocumentConnectionEdges = {
|
||||
__typename?: 'DocumentConnectionEdges';
|
||||
cursor: Scalars['String'];
|
||||
node?: Maybe<DocumentNode>;
|
||||
};
|
||||
|
||||
export type DocumentConnection = Connection & {
|
||||
__typename?: 'DocumentConnection';
|
||||
pageInfo: PageInfo;
|
||||
totalCount: Scalars['Float'];
|
||||
edges?: Maybe<Array<Maybe<DocumentConnectionEdges>>>;
|
||||
};
|
||||
|
||||
export type Collection = {
|
||||
__typename?: 'Collection';
|
||||
name: Scalars['String'];
|
||||
slug: Scalars['String'];
|
||||
label?: Maybe<Scalars['String']>;
|
||||
path: Scalars['String'];
|
||||
format?: Maybe<Scalars['String']>;
|
||||
matches?: Maybe<Scalars['String']>;
|
||||
templates?: Maybe<Array<Maybe<Scalars['JSON']>>>;
|
||||
fields?: Maybe<Array<Maybe<Scalars['JSON']>>>;
|
||||
documents: DocumentConnection;
|
||||
};
|
||||
|
||||
|
||||
export type CollectionDocumentsArgs = {
|
||||
before?: InputMaybe<Scalars['String']>;
|
||||
after?: InputMaybe<Scalars['String']>;
|
||||
first?: InputMaybe<Scalars['Float']>;
|
||||
last?: InputMaybe<Scalars['Float']>;
|
||||
sort?: InputMaybe<Scalars['String']>;
|
||||
filter?: InputMaybe<DocumentFilter>;
|
||||
folder?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type DocumentNode = Post | Folder;
|
||||
|
||||
export type Post = Node & Document & {
|
||||
__typename?: 'Post';
|
||||
title: Scalars['String'];
|
||||
body?: Maybe<Scalars['JSON']>;
|
||||
id: Scalars['ID'];
|
||||
_sys: SystemInfo;
|
||||
_values: Scalars['JSON'];
|
||||
};
|
||||
|
||||
export type StringFilter = {
|
||||
startsWith?: InputMaybe<Scalars['String']>;
|
||||
eq?: InputMaybe<Scalars['String']>;
|
||||
exists?: InputMaybe<Scalars['Boolean']>;
|
||||
in?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
|
||||
};
|
||||
|
||||
export type RichTextFilter = {
|
||||
startsWith?: InputMaybe<Scalars['String']>;
|
||||
eq?: InputMaybe<Scalars['String']>;
|
||||
exists?: InputMaybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type PostFilter = {
|
||||
title?: InputMaybe<StringFilter>;
|
||||
body?: InputMaybe<RichTextFilter>;
|
||||
};
|
||||
|
||||
export type PostConnectionEdges = {
|
||||
__typename?: 'PostConnectionEdges';
|
||||
cursor: Scalars['String'];
|
||||
node?: Maybe<Post>;
|
||||
};
|
||||
|
||||
export type PostConnection = Connection & {
|
||||
__typename?: 'PostConnection';
|
||||
pageInfo: PageInfo;
|
||||
totalCount: Scalars['Float'];
|
||||
edges?: Maybe<Array<Maybe<PostConnectionEdges>>>;
|
||||
};
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
addPendingDocument: DocumentNode;
|
||||
updateDocument: DocumentNode;
|
||||
deleteDocument: DocumentNode;
|
||||
createDocument: DocumentNode;
|
||||
updatePost: Post;
|
||||
createPost: Post;
|
||||
};
|
||||
|
||||
|
||||
export type MutationAddPendingDocumentArgs = {
|
||||
collection: Scalars['String'];
|
||||
relativePath: Scalars['String'];
|
||||
template?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateDocumentArgs = {
|
||||
collection?: InputMaybe<Scalars['String']>;
|
||||
relativePath: Scalars['String'];
|
||||
params: DocumentUpdateMutation;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteDocumentArgs = {
|
||||
collection?: InputMaybe<Scalars['String']>;
|
||||
relativePath: Scalars['String'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateDocumentArgs = {
|
||||
collection?: InputMaybe<Scalars['String']>;
|
||||
relativePath: Scalars['String'];
|
||||
params: DocumentMutation;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdatePostArgs = {
|
||||
relativePath: Scalars['String'];
|
||||
params: PostMutation;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreatePostArgs = {
|
||||
relativePath: Scalars['String'];
|
||||
params: PostMutation;
|
||||
};
|
||||
|
||||
export type DocumentUpdateMutation = {
|
||||
post?: InputMaybe<PostMutation>;
|
||||
relativePath?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type DocumentMutation = {
|
||||
post?: InputMaybe<PostMutation>;
|
||||
};
|
||||
|
||||
export type PostMutation = {
|
||||
title?: InputMaybe<Scalars['String']>;
|
||||
body?: InputMaybe<Scalars['JSON']>;
|
||||
};
|
||||
|
||||
export type PostPartsFragment = { __typename?: 'Post', title: string, body?: any | null };
|
||||
|
||||
export type PostQueryVariables = Exact<{
|
||||
relativePath: Scalars['String'];
|
||||
}>;
|
||||
|
||||
|
||||
export type PostQuery = { __typename?: 'Query', post: { __typename?: 'Post', id: string, title: string, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } };
|
||||
|
||||
export type PostConnectionQueryVariables = Exact<{
|
||||
before?: InputMaybe<Scalars['String']>;
|
||||
after?: InputMaybe<Scalars['String']>;
|
||||
first?: InputMaybe<Scalars['Float']>;
|
||||
last?: InputMaybe<Scalars['Float']>;
|
||||
sort?: InputMaybe<Scalars['String']>;
|
||||
filter?: InputMaybe<PostFilter>;
|
||||
}>;
|
||||
|
||||
|
||||
export type PostConnectionQuery = { __typename?: 'Query', postConnection: { __typename?: 'PostConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'PostConnectionEdges', cursor: string, node?: { __typename?: 'Post', id: string, title: string, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } };
|
||||
|
||||
export const PostPartsFragmentDoc = gql`
|
||||
fragment PostParts on Post {
|
||||
title
|
||||
body
|
||||
}
|
||||
`;
|
||||
export const PostDocument = gql`
|
||||
query post($relativePath: String!) {
|
||||
post(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
_sys {
|
||||
filename
|
||||
basename
|
||||
breadcrumbs
|
||||
path
|
||||
relativePath
|
||||
extension
|
||||
}
|
||||
id
|
||||
}
|
||||
...PostParts
|
||||
}
|
||||
}
|
||||
${PostPartsFragmentDoc}`;
|
||||
export const PostConnectionDocument = gql`
|
||||
query postConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: PostFilter) {
|
||||
postConnection(
|
||||
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
|
||||
breadcrumbs
|
||||
path
|
||||
relativePath
|
||||
extension
|
||||
}
|
||||
id
|
||||
}
|
||||
...PostParts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${PostPartsFragmentDoc}`;
|
||||
export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R>
|
||||
export function getSdk<C>(requester: Requester<C>) {
|
||||
return {
|
||||
post(variables: PostQueryVariables, options?: C): Promise<{data: PostQuery, variables: PostQueryVariables, query: string}> {
|
||||
return requester<{data: PostQuery, variables: PostQueryVariables, query: string}, PostQueryVariables>(PostDocument, variables, options);
|
||||
},
|
||||
postConnection(variables?: PostConnectionQueryVariables, options?: C): Promise<{data: PostConnectionQuery, variables: PostConnectionQueryVariables, query: string}> {
|
||||
return requester<{data: PostConnectionQuery, variables: PostConnectionQueryVariables, query: string}, PostConnectionQueryVariables>(PostConnectionDocument, variables, options);
|
||||
}
|
||||
};
|
||||
}
|
||||
export type Sdk = ReturnType<typeof getSdk>;
|
||||
|
||||
// TinaSDK generated code
|
||||
import { createClient, TinaClient } from "tinacms/dist/client";
|
||||
|
||||
const generateRequester = (client: TinaClient) => {
|
||||
const requester: (
|
||||
doc: any,
|
||||
vars?: any,
|
||||
options?: any,
|
||||
client
|
||||
) => Promise<any> = async (doc, vars, _options) => {
|
||||
const data = await client.request({
|
||||
query: doc,
|
||||
variables: vars,
|
||||
});
|
||||
|
||||
return { data: data?.data, query: doc, variables: vars || {} };
|
||||
};
|
||||
|
||||
return requester;
|
||||
};
|
||||
|
||||
/**
|
||||
* @experimental this class can be used but may change in the future
|
||||
**/
|
||||
export const ExperimentalGetTinaClient = () =>
|
||||
getSdk(
|
||||
generateRequester(createClient({ url: "https://content.tinajs.io/1.4/content/c7fe2362-7424-4956-a241-4d246238f406/github/devin/1739369831-add-tina-cms", queries }))
|
||||
);
|
||||
|
||||
export const queries = (client: TinaClient) => {
|
||||
const requester = generateRequester(client);
|
||||
return getSdk(requester);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user