fixing tina
This commit is contained in:
Generated
+1
-1
File diff suppressed because one or more lines are too long
Generated
+1
-1
@@ -1 +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"}}
|
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["post","products"]},"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"},"Products":{"type":"Products","resolveType":"collectionDocument","collection":"products","createProducts":"create","updateProducts":"update"},"ProductsConnection":{"type":"ProductsConnection","resolveType":"collectionDocumentList","collection":"products"}}
|
||||||
Generated
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":{"fullVersion":"1.4.27","major":"1","minor":"4","patch":"27"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"post","label":"Posts","path":"content/posts","fields":[{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["post","title"],"searchable":true},{"type":"rich-text","name":"body","label":"Body","isBody":true,"namespace":["post","body"],"searchable":true,"parser":{"type":"markdown"}}],"namespace":["post"]}],"config":{"media":{"tina":{"publicFolder":"static","mediaRoot":""}}}}
|
{"version":{"fullVersion":"1.4.27","major":"1","minor":"4","patch":"27"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"post","label":"Posts","path":"content/posts","fields":[{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["post","title"],"searchable":true},{"type":"rich-text","name":"body","label":"Body","isBody":true,"namespace":["post","body"],"searchable":true,"parser":{"type":"markdown"}}],"namespace":["post"]},{"name":"products","label":"Products","path":"content/products","fields":[{"type":"string","name":"productName","title":"Product Name","isTitle":true,"required":true,"namespace":["products","productName"],"searchable":true},{"type":"rich-text","name":"description","label":"Description","isBody":true,"namespace":["products","description"],"searchable":true,"parser":{"type":"markdown"}}],"namespace":["products"]}],"config":{"media":{"tina":{"publicFolder":"static","mediaRoot":""}}}}
|
||||||
Generated
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { createClient } from "tinacms/dist/client";
|
import { createClient } from "tinacms/dist/client";
|
||||||
import { queries } from "./types";
|
import { queries } from "./types";
|
||||||
export const client = createClient({ url: 'https://content.tinajs.io/1.4/content/263d908d-7712-4d39-b378-5019e6d7ba45/github/main', token: '91dfa2f9c48a168d96f77629d51413a93250f072', queries, });
|
export const client = createClient({ url: 'http://localhost:4001/graphql', token: 'e1040fd77966916ca7aa0b2480f9c6bbf865fe7d', queries, });
|
||||||
export default client;
|
export default client;
|
||||||
|
|
||||||
Generated
+22
-2
@@ -3,9 +3,9 @@ import { defineConfig } from "tinacms";
|
|||||||
var branch = process.env.HEAD || process.env.VERCEL_GIT_COMMIT_REF || "main";
|
var branch = process.env.HEAD || process.env.VERCEL_GIT_COMMIT_REF || "main";
|
||||||
var config_default = defineConfig({
|
var config_default = defineConfig({
|
||||||
branch,
|
branch,
|
||||||
clientId: "263d908d-7712-4d39-b378-5019e6d7ba45",
|
clientId: "f68869c9-46b7-4f70-bf52-46783f537a63",
|
||||||
// Get this from tina.io
|
// Get this from tina.io
|
||||||
token: "91dfa2f9c48a168d96f77629d51413a93250f072",
|
token: "e1040fd77966916ca7aa0b2480f9c6bbf865fe7d",
|
||||||
// Get this from tina.io
|
// Get this from tina.io
|
||||||
build: {
|
build: {
|
||||||
outputFolder: "admin",
|
outputFolder: "admin",
|
||||||
@@ -38,6 +38,26 @@ var config_default = defineConfig({
|
|||||||
isBody: true
|
isBody: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "products",
|
||||||
|
label: "Products",
|
||||||
|
path: "content/products",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
name: "productName",
|
||||||
|
title: "Product Name",
|
||||||
|
isTitle: true,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "rich-text",
|
||||||
|
name: "description",
|
||||||
|
label: "Description",
|
||||||
|
isBody: true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+6
@@ -3,3 +3,9 @@ fragment PostParts on Post {
|
|||||||
title
|
title
|
||||||
body
|
body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fragment ProductsParts on Products {
|
||||||
|
__typename
|
||||||
|
productName
|
||||||
|
description
|
||||||
|
}
|
||||||
|
|||||||
Generated
+53
@@ -50,3 +50,56 @@ query postConnection($before: String, $after: String, $first: Float, $last: Floa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query products($relativePath: String!) {
|
||||||
|
products(relativePath: $relativePath) {
|
||||||
|
... on Document {
|
||||||
|
_sys {
|
||||||
|
filename
|
||||||
|
basename
|
||||||
|
breadcrumbs
|
||||||
|
path
|
||||||
|
relativePath
|
||||||
|
extension
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
...ProductsParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query productsConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: ProductsFilter) {
|
||||||
|
productsConnection(
|
||||||
|
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
|
||||||
|
}
|
||||||
|
...ProductsParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Generated
+37
-1
@@ -55,10 +55,13 @@ type Query {
|
|||||||
document(collection: String, relativePath: String): DocumentNode!
|
document(collection: String, relativePath: String): DocumentNode!
|
||||||
post(relativePath: String): Post!
|
post(relativePath: String): Post!
|
||||||
postConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: PostFilter): PostConnection!
|
postConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: PostFilter): PostConnection!
|
||||||
|
products(relativePath: String): Products!
|
||||||
|
productsConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: ProductsFilter): ProductsConnection!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentFilter {
|
input DocumentFilter {
|
||||||
post: PostFilter
|
post: PostFilter
|
||||||
|
products: ProductsFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
type DocumentConnectionEdges {
|
type DocumentConnectionEdges {
|
||||||
@@ -84,7 +87,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 = Post | Folder
|
union DocumentNode = Post | Products | Folder
|
||||||
|
|
||||||
type Post implements Node & Document {
|
type Post implements Node & Document {
|
||||||
title: String!
|
title: String!
|
||||||
@@ -123,6 +126,30 @@ type PostConnection implements Connection {
|
|||||||
edges: [PostConnectionEdges]
|
edges: [PostConnectionEdges]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Products implements Node & Document {
|
||||||
|
productName: String!
|
||||||
|
description: JSON
|
||||||
|
id: ID!
|
||||||
|
_sys: SystemInfo!
|
||||||
|
_values: JSON!
|
||||||
|
}
|
||||||
|
|
||||||
|
input ProductsFilter {
|
||||||
|
productName: StringFilter
|
||||||
|
description: RichTextFilter
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProductsConnectionEdges {
|
||||||
|
cursor: String!
|
||||||
|
node: Products
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProductsConnection implements Connection {
|
||||||
|
pageInfo: PageInfo!
|
||||||
|
totalCount: Float!
|
||||||
|
edges: [ProductsConnectionEdges]
|
||||||
|
}
|
||||||
|
|
||||||
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!
|
||||||
@@ -130,15 +157,19 @@ type Mutation {
|
|||||||
createDocument(collection: String, relativePath: String!, params: DocumentMutation!): DocumentNode!
|
createDocument(collection: String, relativePath: String!, params: DocumentMutation!): DocumentNode!
|
||||||
updatePost(relativePath: String!, params: PostMutation!): Post!
|
updatePost(relativePath: String!, params: PostMutation!): Post!
|
||||||
createPost(relativePath: String!, params: PostMutation!): Post!
|
createPost(relativePath: String!, params: PostMutation!): Post!
|
||||||
|
updateProducts(relativePath: String!, params: ProductsMutation!): Products!
|
||||||
|
createProducts(relativePath: String!, params: ProductsMutation!): Products!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentUpdateMutation {
|
input DocumentUpdateMutation {
|
||||||
post: PostMutation
|
post: PostMutation
|
||||||
|
products: ProductsMutation
|
||||||
relativePath: String
|
relativePath: String
|
||||||
}
|
}
|
||||||
|
|
||||||
input DocumentMutation {
|
input DocumentMutation {
|
||||||
post: PostMutation
|
post: PostMutation
|
||||||
|
products: ProductsMutation
|
||||||
}
|
}
|
||||||
|
|
||||||
input PostMutation {
|
input PostMutation {
|
||||||
@@ -146,6 +177,11 @@ input PostMutation {
|
|||||||
body: JSON
|
body: JSON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input ProductsMutation {
|
||||||
|
productName: String
|
||||||
|
description: JSON
|
||||||
|
}
|
||||||
|
|
||||||
schema {
|
schema {
|
||||||
query: Query
|
query: Query
|
||||||
mutation: Mutation
|
mutation: Mutation
|
||||||
|
|||||||
Generated
+157
-2
@@ -83,6 +83,8 @@ export type Query = {
|
|||||||
document: DocumentNode;
|
document: DocumentNode;
|
||||||
post: Post;
|
post: Post;
|
||||||
postConnection: PostConnection;
|
postConnection: PostConnection;
|
||||||
|
products: Products;
|
||||||
|
productsConnection: ProductsConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -121,8 +123,24 @@ export type QueryPostConnectionArgs = {
|
|||||||
filter?: InputMaybe<PostFilter>;
|
filter?: InputMaybe<PostFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type QueryProductsArgs = {
|
||||||
|
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type QueryProductsConnectionArgs = {
|
||||||
|
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<ProductsFilter>;
|
||||||
|
};
|
||||||
|
|
||||||
export type DocumentFilter = {
|
export type DocumentFilter = {
|
||||||
post?: InputMaybe<PostFilter>;
|
post?: InputMaybe<PostFilter>;
|
||||||
|
products?: InputMaybe<ProductsFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentConnectionEdges = {
|
export type DocumentConnectionEdges = {
|
||||||
@@ -162,7 +180,7 @@ export type CollectionDocumentsArgs = {
|
|||||||
folder?: InputMaybe<Scalars['String']['input']>;
|
folder?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentNode = Post | Folder;
|
export type DocumentNode = Post | Products | Folder;
|
||||||
|
|
||||||
export type Post = Node & Document & {
|
export type Post = Node & Document & {
|
||||||
__typename?: 'Post';
|
__typename?: 'Post';
|
||||||
@@ -204,6 +222,33 @@ export type PostConnection = Connection & {
|
|||||||
edges?: Maybe<Array<Maybe<PostConnectionEdges>>>;
|
edges?: Maybe<Array<Maybe<PostConnectionEdges>>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type Products = Node & Document & {
|
||||||
|
__typename?: 'Products';
|
||||||
|
productName: Scalars['String']['output'];
|
||||||
|
description?: Maybe<Scalars['JSON']['output']>;
|
||||||
|
id: Scalars['ID']['output'];
|
||||||
|
_sys: SystemInfo;
|
||||||
|
_values: Scalars['JSON']['output'];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ProductsFilter = {
|
||||||
|
productName?: InputMaybe<StringFilter>;
|
||||||
|
description?: InputMaybe<RichTextFilter>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ProductsConnectionEdges = {
|
||||||
|
__typename?: 'ProductsConnectionEdges';
|
||||||
|
cursor: Scalars['String']['output'];
|
||||||
|
node?: Maybe<Products>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ProductsConnection = Connection & {
|
||||||
|
__typename?: 'ProductsConnection';
|
||||||
|
pageInfo: PageInfo;
|
||||||
|
totalCount: Scalars['Float']['output'];
|
||||||
|
edges?: Maybe<Array<Maybe<ProductsConnectionEdges>>>;
|
||||||
|
};
|
||||||
|
|
||||||
export type Mutation = {
|
export type Mutation = {
|
||||||
__typename?: 'Mutation';
|
__typename?: 'Mutation';
|
||||||
addPendingDocument: DocumentNode;
|
addPendingDocument: DocumentNode;
|
||||||
@@ -212,6 +257,8 @@ export type Mutation = {
|
|||||||
createDocument: DocumentNode;
|
createDocument: DocumentNode;
|
||||||
updatePost: Post;
|
updatePost: Post;
|
||||||
createPost: Post;
|
createPost: Post;
|
||||||
|
updateProducts: Products;
|
||||||
|
createProducts: Products;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -253,13 +300,27 @@ export type MutationCreatePostArgs = {
|
|||||||
params: PostMutation;
|
params: PostMutation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type MutationUpdateProductsArgs = {
|
||||||
|
relativePath: Scalars['String']['input'];
|
||||||
|
params: ProductsMutation;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type MutationCreateProductsArgs = {
|
||||||
|
relativePath: Scalars['String']['input'];
|
||||||
|
params: ProductsMutation;
|
||||||
|
};
|
||||||
|
|
||||||
export type DocumentUpdateMutation = {
|
export type DocumentUpdateMutation = {
|
||||||
post?: InputMaybe<PostMutation>;
|
post?: InputMaybe<PostMutation>;
|
||||||
|
products?: InputMaybe<ProductsMutation>;
|
||||||
relativePath?: InputMaybe<Scalars['String']['input']>;
|
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentMutation = {
|
export type DocumentMutation = {
|
||||||
post?: InputMaybe<PostMutation>;
|
post?: InputMaybe<PostMutation>;
|
||||||
|
products?: InputMaybe<ProductsMutation>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PostMutation = {
|
export type PostMutation = {
|
||||||
@@ -267,8 +328,15 @@ export type PostMutation = {
|
|||||||
body?: InputMaybe<Scalars['JSON']['input']>;
|
body?: InputMaybe<Scalars['JSON']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type ProductsMutation = {
|
||||||
|
productName?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
description?: InputMaybe<Scalars['JSON']['input']>;
|
||||||
|
};
|
||||||
|
|
||||||
export type PostPartsFragment = { __typename: 'Post', title: string, body?: any | null };
|
export type PostPartsFragment = { __typename: 'Post', title: string, body?: any | null };
|
||||||
|
|
||||||
|
export type ProductsPartsFragment = { __typename: 'Products', productName: string, description?: any | null };
|
||||||
|
|
||||||
export type PostQueryVariables = Exact<{
|
export type PostQueryVariables = Exact<{
|
||||||
relativePath: Scalars['String']['input'];
|
relativePath: Scalars['String']['input'];
|
||||||
}>;
|
}>;
|
||||||
@@ -288,6 +356,25 @@ export type PostConnectionQueryVariables = Exact<{
|
|||||||
|
|
||||||
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 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 type ProductsQueryVariables = Exact<{
|
||||||
|
relativePath: Scalars['String']['input'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type ProductsQuery = { __typename?: 'Query', products: { __typename: 'Products', id: string, productName: string, description?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } };
|
||||||
|
|
||||||
|
export type ProductsConnectionQueryVariables = 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<ProductsFilter>;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type ProductsConnectionQuery = { __typename?: 'Query', productsConnection: { __typename?: 'ProductsConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'ProductsConnectionEdges', cursor: string, node?: { __typename: 'Products', id: string, productName: string, description?: 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`
|
export const PostPartsFragmentDoc = gql`
|
||||||
fragment PostParts on Post {
|
fragment PostParts on Post {
|
||||||
__typename
|
__typename
|
||||||
@@ -295,6 +382,13 @@ export const PostPartsFragmentDoc = gql`
|
|||||||
body
|
body
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
export const ProductsPartsFragmentDoc = gql`
|
||||||
|
fragment ProductsParts on Products {
|
||||||
|
__typename
|
||||||
|
productName
|
||||||
|
description
|
||||||
|
}
|
||||||
|
`;
|
||||||
export const PostDocument = gql`
|
export const PostDocument = gql`
|
||||||
query post($relativePath: String!) {
|
query post($relativePath: String!) {
|
||||||
post(relativePath: $relativePath) {
|
post(relativePath: $relativePath) {
|
||||||
@@ -350,6 +444,61 @@ export const PostConnectionDocument = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
${PostPartsFragmentDoc}`;
|
${PostPartsFragmentDoc}`;
|
||||||
|
export const ProductsDocument = gql`
|
||||||
|
query products($relativePath: String!) {
|
||||||
|
products(relativePath: $relativePath) {
|
||||||
|
... on Document {
|
||||||
|
_sys {
|
||||||
|
filename
|
||||||
|
basename
|
||||||
|
breadcrumbs
|
||||||
|
path
|
||||||
|
relativePath
|
||||||
|
extension
|
||||||
|
}
|
||||||
|
id
|
||||||
|
}
|
||||||
|
...ProductsParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${ProductsPartsFragmentDoc}`;
|
||||||
|
export const ProductsConnectionDocument = gql`
|
||||||
|
query productsConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: ProductsFilter) {
|
||||||
|
productsConnection(
|
||||||
|
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
|
||||||
|
}
|
||||||
|
...ProductsParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${ProductsPartsFragmentDoc}`;
|
||||||
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 {
|
||||||
@@ -358,6 +507,12 @@ export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C)
|
|||||||
},
|
},
|
||||||
postConnection(variables?: PostConnectionQueryVariables, options?: C): Promise<{data: PostConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostConnectionQueryVariables, query: string}> {
|
postConnection(variables?: PostConnectionQueryVariables, options?: C): Promise<{data: PostConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostConnectionQueryVariables, query: string}> {
|
||||||
return requester<{data: PostConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostConnectionQueryVariables, query: string}, PostConnectionQueryVariables>(PostConnectionDocument, variables, options);
|
return requester<{data: PostConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostConnectionQueryVariables, query: string}, PostConnectionQueryVariables>(PostConnectionDocument, variables, options);
|
||||||
|
},
|
||||||
|
products(variables: ProductsQueryVariables, options?: C): Promise<{data: ProductsQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: ProductsQueryVariables, query: string}> {
|
||||||
|
return requester<{data: ProductsQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: ProductsQueryVariables, query: string}, ProductsQueryVariables>(ProductsDocument, variables, options);
|
||||||
|
},
|
||||||
|
productsConnection(variables?: ProductsConnectionQueryVariables, options?: C): Promise<{data: ProductsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: ProductsConnectionQueryVariables, query: string}> {
|
||||||
|
return requester<{data: ProductsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: ProductsConnectionQueryVariables, query: string}, ProductsConnectionQueryVariables>(ProductsConnectionDocument, variables, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -400,7 +555,7 @@ export const ExperimentalGetTinaClient = () =>
|
|||||||
getSdk(
|
getSdk(
|
||||||
generateRequester(
|
generateRequester(
|
||||||
createClient({
|
createClient({
|
||||||
url: "https://content.tinajs.io/1.4/content/263d908d-7712-4d39-b378-5019e6d7ba45/github/main",
|
url: "http://localhost:4001/graphql",
|
||||||
queries,
|
queries,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user