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","page","theaterHomepage"]},"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"},"Page":{"type":"Page","resolveType":"collectionDocument","collection":"page","createPage":"create","updatePage":"update"},"PageConnection":{"type":"PageConnection","resolveType":"collectionDocumentList","collection":"page"},"TheaterHomepage":{"type":"TheaterHomepage","resolveType":"collectionDocument","collection":"theaterHomepage","createTheaterHomepage":"create","updateTheaterHomepage":"update"},"TheaterHomepageConnection":{"type":"TheaterHomepageConnection","resolveType":"collectionDocumentList","collection":"theaterHomepage"}}
|
||||
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["user","post","page","theaterHomepage"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"User":{"type":"User","resolveType":"collectionDocument","collection":"user","createUser":"create","updateUser":"update"},"UserConnection":{"type":"UserConnection","resolveType":"collectionDocumentList","collection":"user"},"Post":{"type":"Post","resolveType":"collectionDocument","collection":"post","createPost":"create","updatePost":"update"},"PostConnection":{"type":"PostConnection","resolveType":"collectionDocumentList","collection":"post"},"Page":{"type":"Page","resolveType":"collectionDocument","collection":"page","createPage":"create","updatePage":"update"},"PageConnection":{"type":"PageConnection","resolveType":"collectionDocumentList","collection":"page"},"TheaterHomepage":{"type":"TheaterHomepage","resolveType":"collectionDocument","collection":"theaterHomepage","createTheaterHomepage":"create","updateTheaterHomepage":"update"},"TheaterHomepageConnection":{"type":"TheaterHomepageConnection","resolveType":"collectionDocumentList","collection":"theaterHomepage"}}
|
||||
Generated
+1
-1
File diff suppressed because one or more lines are too long
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { createClient } from "tinacms/dist/client";
|
||||
import { queries } from "./types";
|
||||
export const client = createClient({ url: 'http://localhost:4001/graphql', token: '', queries, });
|
||||
export const client = createClient({ cacheDir: '/home/johannes/work/ideal/theater-ziefen-website/tina/__generated__/.cache/1777917319596', url: '/api/tina/gql', token: 'undefined', queries, });
|
||||
export default client;
|
||||
|
||||
Generated
+63
@@ -0,0 +1,63 @@
|
||||
// @ts-nocheck
|
||||
import { resolve } from "@tinacms/datalayer";
|
||||
import type { TinaClient } from "tinacms/dist/client";
|
||||
|
||||
import { queries } from "./types";
|
||||
import database from "../database";
|
||||
|
||||
export async function databaseRequest({ query, variables, user }) {
|
||||
const result = await resolve({
|
||||
config: {
|
||||
useRelativeMedia: true,
|
||||
},
|
||||
database,
|
||||
query,
|
||||
variables,
|
||||
verbose: true,
|
||||
ctxUser: user,
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function authenticate({ username, password }) {
|
||||
return databaseRequest({
|
||||
query: `query auth($username:String!, $password:String!) {
|
||||
authenticate(sub:$username, password:$password) {
|
||||
id:username name email _password: password { passwordChangeRequired }
|
||||
}
|
||||
}`,
|
||||
variables: { username, password },
|
||||
})
|
||||
}
|
||||
|
||||
export async function authorize(user: { sub: string }) {
|
||||
return databaseRequest({
|
||||
query: `query authz { authorize { id:username name email _password: password { passwordChangeRequired }} }`,
|
||||
variables: {},
|
||||
user
|
||||
})
|
||||
}
|
||||
|
||||
function createDatabaseClient<GenQueries = Record<string, unknown>>({
|
||||
queries,
|
||||
}: {
|
||||
queries: (client: {
|
||||
request: TinaClient<GenQueries>["request"];
|
||||
}) => GenQueries;
|
||||
}) {
|
||||
const request = async ({ query, variables, user }) => {
|
||||
const data = await databaseRequest({ query, variables, user });
|
||||
return { data: data.data as any, query, variables, errors: data.errors || null };
|
||||
};
|
||||
const q = queries({
|
||||
request,
|
||||
});
|
||||
return { queries: q, request, authenticate, authorize };
|
||||
}
|
||||
|
||||
export const databaseClient = createDatabaseClient({ queries });
|
||||
|
||||
export const client = databaseClient;
|
||||
|
||||
export default databaseClient;
|
||||
Generated
+14
@@ -1,3 +1,17 @@
|
||||
fragment UserParts on User {
|
||||
__typename
|
||||
users {
|
||||
__typename
|
||||
username
|
||||
name
|
||||
email
|
||||
password {
|
||||
value
|
||||
passwordChangeRequired
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment PostParts on Post {
|
||||
__typename
|
||||
title
|
||||
|
||||
Generated
+55
@@ -1,3 +1,58 @@
|
||||
query user($relativePath: String!) {
|
||||
user(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
_sys {
|
||||
filename
|
||||
basename
|
||||
hasReferences
|
||||
breadcrumbs
|
||||
path
|
||||
relativePath
|
||||
extension
|
||||
}
|
||||
id
|
||||
}
|
||||
...UserParts
|
||||
}
|
||||
}
|
||||
|
||||
query userConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: UserFilter) {
|
||||
userConnection(
|
||||
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
|
||||
}
|
||||
...UserParts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query post($relativePath: String!) {
|
||||
post(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
|
||||
Generated
+73
-7
@@ -54,6 +54,10 @@ type Query {
|
||||
collections: [Collection!]!
|
||||
node(id: String): Node!
|
||||
document(collection: String, relativePath: String): DocumentNode!
|
||||
user(relativePath: String): User!
|
||||
authenticate(sub: String!, password: String!): UserUsers
|
||||
authorize: UserUsers
|
||||
userConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: UserFilter): UserConnection!
|
||||
post(relativePath: String): Post!
|
||||
postConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: PostFilter): PostConnection!
|
||||
page(relativePath: String): Page!
|
||||
@@ -63,6 +67,7 @@ type Query {
|
||||
}
|
||||
|
||||
input DocumentFilter {
|
||||
user: UserFilter
|
||||
post: PostFilter
|
||||
page: PageFilter
|
||||
theaterHomepage: TheaterHomepageFilter
|
||||
@@ -91,14 +96,22 @@ type Collection {
|
||||
documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection!
|
||||
}
|
||||
|
||||
union DocumentNode = Post | Page | TheaterHomepage | Folder
|
||||
union DocumentNode = User | Post | Page | TheaterHomepage | Folder
|
||||
|
||||
type Post implements Node & Document {
|
||||
title: String!
|
||||
date: String!
|
||||
excerpt: String!
|
||||
coverImage: String
|
||||
body: JSON!
|
||||
type UserUsersPassword {
|
||||
value: String!
|
||||
passwordChangeRequired: Boolean
|
||||
}
|
||||
|
||||
type UserUsers {
|
||||
username: String!
|
||||
name: String
|
||||
email: String
|
||||
password: UserUsersPassword!
|
||||
}
|
||||
|
||||
type User implements Node & Document {
|
||||
users: [UserUsers]
|
||||
id: ID!
|
||||
_sys: SystemInfo!
|
||||
_values: JSON!
|
||||
@@ -111,6 +124,38 @@ input StringFilter {
|
||||
in: [String]
|
||||
}
|
||||
|
||||
input UserUsersFilter {
|
||||
username: StringFilter
|
||||
name: StringFilter
|
||||
email: StringFilter
|
||||
}
|
||||
|
||||
input UserFilter {
|
||||
users: UserUsersFilter
|
||||
}
|
||||
|
||||
type UserConnectionEdges {
|
||||
cursor: String!
|
||||
node: User
|
||||
}
|
||||
|
||||
type UserConnection implements Connection {
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Float!
|
||||
edges: [UserConnectionEdges]
|
||||
}
|
||||
|
||||
type Post implements Node & Document {
|
||||
title: String!
|
||||
date: String!
|
||||
excerpt: String!
|
||||
coverImage: String
|
||||
body: JSON!
|
||||
id: ID!
|
||||
_sys: SystemInfo!
|
||||
_values: JSON!
|
||||
}
|
||||
|
||||
input DatetimeFilter {
|
||||
after: String
|
||||
before: String
|
||||
@@ -387,6 +432,9 @@ type Mutation {
|
||||
deleteDocument(collection: String, relativePath: String!): DocumentNode!
|
||||
createDocument(collection: String, relativePath: String!, params: DocumentMutation!): DocumentNode!
|
||||
createFolder(collection: String, relativePath: String!): DocumentNode!
|
||||
updatePassword(password: String!): Boolean!
|
||||
updateUser(relativePath: String!, params: UserMutation!): User!
|
||||
createUser(relativePath: String!, params: UserMutation!): User!
|
||||
updatePost(relativePath: String!, params: PostMutation!): Post!
|
||||
createPost(relativePath: String!, params: PostMutation!): Post!
|
||||
updatePage(relativePath: String!, params: PageMutation!): Page!
|
||||
@@ -396,6 +444,7 @@ type Mutation {
|
||||
}
|
||||
|
||||
input DocumentUpdateMutation {
|
||||
user: UserMutation
|
||||
post: PostMutation
|
||||
page: PageMutation
|
||||
theaterHomepage: TheaterHomepageMutation
|
||||
@@ -403,11 +452,28 @@ input DocumentUpdateMutation {
|
||||
}
|
||||
|
||||
input DocumentMutation {
|
||||
user: UserMutation
|
||||
post: PostMutation
|
||||
page: PageMutation
|
||||
theaterHomepage: TheaterHomepageMutation
|
||||
}
|
||||
|
||||
input UserUsersPasswordMutation {
|
||||
value: String
|
||||
passwordChangeRequired: Boolean!
|
||||
}
|
||||
|
||||
input UserUsersMutation {
|
||||
username: String
|
||||
name: String
|
||||
email: String
|
||||
password: UserUsersPasswordMutation
|
||||
}
|
||||
|
||||
input UserMutation {
|
||||
users: [UserUsersMutation]
|
||||
}
|
||||
|
||||
input PostMutation {
|
||||
title: String
|
||||
date: String
|
||||
|
||||
Generated
+218
-10
@@ -82,6 +82,10 @@ export type Query = {
|
||||
collections: Array<Collection>;
|
||||
node: Node;
|
||||
document: DocumentNode;
|
||||
user: User;
|
||||
authenticate?: Maybe<UserUsers>;
|
||||
authorize?: Maybe<UserUsers>;
|
||||
userConnection: UserConnection;
|
||||
post: Post;
|
||||
postConnection: PostConnection;
|
||||
page: Page;
|
||||
@@ -112,6 +116,27 @@ export type QueryDocumentArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryUserArgs = {
|
||||
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryAuthenticateArgs = {
|
||||
sub: Scalars['String']['input'];
|
||||
password: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryUserConnectionArgs = {
|
||||
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<UserFilter>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryPostArgs = {
|
||||
relativePath?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
@@ -157,6 +182,7 @@ export type QueryTheaterHomepageConnectionArgs = {
|
||||
};
|
||||
|
||||
export type DocumentFilter = {
|
||||
user?: InputMaybe<UserFilter>;
|
||||
post?: InputMaybe<PostFilter>;
|
||||
page?: InputMaybe<PageFilter>;
|
||||
theaterHomepage?: InputMaybe<TheaterHomepageFilter>;
|
||||
@@ -199,7 +225,59 @@ export type CollectionDocumentsArgs = {
|
||||
folder?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type DocumentNode = Post | Page | TheaterHomepage | Folder;
|
||||
export type DocumentNode = User | Post | Page | TheaterHomepage | Folder;
|
||||
|
||||
export type UserUsersPassword = {
|
||||
__typename?: 'UserUsersPassword';
|
||||
value: Scalars['String']['output'];
|
||||
passwordChangeRequired?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type UserUsers = {
|
||||
__typename?: 'UserUsers';
|
||||
username: Scalars['String']['output'];
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
email?: Maybe<Scalars['String']['output']>;
|
||||
password: UserUsersPassword;
|
||||
};
|
||||
|
||||
export type User = Node & Document & {
|
||||
__typename?: 'User';
|
||||
users?: Maybe<Array<Maybe<UserUsers>>>;
|
||||
id: Scalars['ID']['output'];
|
||||
_sys: SystemInfo;
|
||||
_values: Scalars['JSON']['output'];
|
||||
};
|
||||
|
||||
export type StringFilter = {
|
||||
startsWith?: InputMaybe<Scalars['String']['input']>;
|
||||
eq?: InputMaybe<Scalars['String']['input']>;
|
||||
exists?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
in?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
||||
};
|
||||
|
||||
export type UserUsersFilter = {
|
||||
username?: InputMaybe<StringFilter>;
|
||||
name?: InputMaybe<StringFilter>;
|
||||
email?: InputMaybe<StringFilter>;
|
||||
};
|
||||
|
||||
export type UserFilter = {
|
||||
users?: InputMaybe<UserUsersFilter>;
|
||||
};
|
||||
|
||||
export type UserConnectionEdges = {
|
||||
__typename?: 'UserConnectionEdges';
|
||||
cursor: Scalars['String']['output'];
|
||||
node?: Maybe<User>;
|
||||
};
|
||||
|
||||
export type UserConnection = Connection & {
|
||||
__typename?: 'UserConnection';
|
||||
pageInfo: PageInfo;
|
||||
totalCount: Scalars['Float']['output'];
|
||||
edges?: Maybe<Array<Maybe<UserConnectionEdges>>>;
|
||||
};
|
||||
|
||||
export type Post = Node & Document & {
|
||||
__typename?: 'Post';
|
||||
@@ -213,13 +291,6 @@ export type Post = Node & Document & {
|
||||
_values: Scalars['JSON']['output'];
|
||||
};
|
||||
|
||||
export type StringFilter = {
|
||||
startsWith?: InputMaybe<Scalars['String']['input']>;
|
||||
eq?: InputMaybe<Scalars['String']['input']>;
|
||||
exists?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
in?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
||||
};
|
||||
|
||||
export type DatetimeFilter = {
|
||||
after?: InputMaybe<Scalars['String']['input']>;
|
||||
before?: InputMaybe<Scalars['String']['input']>;
|
||||
@@ -516,6 +587,9 @@ export type Mutation = {
|
||||
deleteDocument: DocumentNode;
|
||||
createDocument: DocumentNode;
|
||||
createFolder: DocumentNode;
|
||||
updatePassword: Scalars['Boolean']['output'];
|
||||
updateUser: User;
|
||||
createUser: User;
|
||||
updatePost: Post;
|
||||
createPost: Post;
|
||||
updatePage: Page;
|
||||
@@ -558,6 +632,23 @@ export type MutationCreateFolderArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdatePasswordArgs = {
|
||||
password: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateUserArgs = {
|
||||
relativePath: Scalars['String']['input'];
|
||||
params: UserMutation;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateUserArgs = {
|
||||
relativePath: Scalars['String']['input'];
|
||||
params: UserMutation;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdatePostArgs = {
|
||||
relativePath: Scalars['String']['input'];
|
||||
params: PostMutation;
|
||||
@@ -594,6 +685,7 @@ export type MutationCreateTheaterHomepageArgs = {
|
||||
};
|
||||
|
||||
export type DocumentUpdateMutation = {
|
||||
user?: InputMaybe<UserMutation>;
|
||||
post?: InputMaybe<PostMutation>;
|
||||
page?: InputMaybe<PageMutation>;
|
||||
theaterHomepage?: InputMaybe<TheaterHomepageMutation>;
|
||||
@@ -601,11 +693,28 @@ export type DocumentUpdateMutation = {
|
||||
};
|
||||
|
||||
export type DocumentMutation = {
|
||||
user?: InputMaybe<UserMutation>;
|
||||
post?: InputMaybe<PostMutation>;
|
||||
page?: InputMaybe<PageMutation>;
|
||||
theaterHomepage?: InputMaybe<TheaterHomepageMutation>;
|
||||
};
|
||||
|
||||
export type UserUsersPasswordMutation = {
|
||||
value?: InputMaybe<Scalars['String']['input']>;
|
||||
passwordChangeRequired: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
export type UserUsersMutation = {
|
||||
username?: InputMaybe<Scalars['String']['input']>;
|
||||
name?: InputMaybe<Scalars['String']['input']>;
|
||||
email?: InputMaybe<Scalars['String']['input']>;
|
||||
password?: InputMaybe<UserUsersPasswordMutation>;
|
||||
};
|
||||
|
||||
export type UserMutation = {
|
||||
users?: InputMaybe<Array<InputMaybe<UserUsersMutation>>>;
|
||||
};
|
||||
|
||||
export type PostMutation = {
|
||||
title?: InputMaybe<Scalars['String']['input']>;
|
||||
date?: InputMaybe<Scalars['String']['input']>;
|
||||
@@ -715,12 +824,33 @@ export type TheaterHomepageMutation = {
|
||||
tickets?: InputMaybe<TheaterHomepageTicketsMutation>;
|
||||
};
|
||||
|
||||
export type UserPartsFragment = { __typename: 'User', users?: Array<{ __typename: 'UserUsers', username: string, name?: string | null, email?: string | null, password: { __typename?: 'UserUsersPassword', value: string, passwordChangeRequired?: boolean | null } } | null> | null };
|
||||
|
||||
export type PostPartsFragment = { __typename: 'Post', title: string, date: string, excerpt: string, coverImage?: string | null, body: any };
|
||||
|
||||
export type PagePartsFragment = { __typename: 'Page', title: string, description?: string | null, body: any };
|
||||
|
||||
export type TheaterHomepagePartsFragment = { __typename: 'TheaterHomepage', title: string, hero?: { __typename: 'TheaterHomepageHero', title_de: string, title_en: string, subtitle_de: string, subtitle_en: string } | null, projekt?: { __typename: 'TheaterHomepageProjekt', title_de: string, title_en: string, content_de: any, content_en: any } | null, team?: { __typename: 'TheaterHomepageTeam', title_de: string, title_en: string, content_de: any, content_en: any, organizations?: Array<{ __typename: 'TheaterHomepageTeamOrganizations', name?: string | null, role_de?: string | null, role_en?: string | null, logo?: string | null, url?: string | null } | null> | null } | null, stueck?: { __typename: 'TheaterHomepageStueck', title_de: string, title_en: string, content_de: any, content_en: any } | null, mitwirkung?: { __typename: 'TheaterHomepageMitwirkung', title_de: string, title_en: string, content_de: any, content_en: any, director_name?: string | null, director_email?: string | null, director_phone?: string | null } | null, termine?: { __typename: 'TheaterHomepageTermine', title_de: string, title_en: string, events?: Array<{ __typename: 'TheaterHomepageTermineEvents', title_de?: string | null, title_en?: string | null, date?: string | null, description_de?: string | null, description_en?: string | null } | null> | null } | null, presse?: { __typename: 'TheaterHomepagePresse', title_de: string, title_en: string, content_de: any, content_en: any } | null, gallery?: { __typename: 'TheaterHomepageGallery', title_de: string, title_en: string, images?: Array<string | null> | null } | null, tickets?: { __typename: 'TheaterHomepageTickets', title_de: string, title_en: string, content_de: any, content_en: any, ticket_url?: string | null } | null };
|
||||
|
||||
export type UserQueryVariables = Exact<{
|
||||
relativePath: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type UserQuery = { __typename?: 'Query', user: { __typename: 'User', id: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, users?: Array<{ __typename: 'UserUsers', username: string, name?: string | null, email?: string | null, password: { __typename?: 'UserUsersPassword', value: string, passwordChangeRequired?: boolean | null } } | null> | null } };
|
||||
|
||||
export type UserConnectionQueryVariables = 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<UserFilter>;
|
||||
}>;
|
||||
|
||||
|
||||
export type UserConnectionQuery = { __typename?: 'Query', userConnection: { __typename?: 'UserConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'UserConnectionEdges', cursor: string, node?: { __typename: 'User', id: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, users?: Array<{ __typename: 'UserUsers', username: string, name?: string | null, email?: string | null, password: { __typename?: 'UserUsersPassword', value: string, passwordChangeRequired?: boolean | null } } | null> | null } | null } | null> | null } };
|
||||
|
||||
export type PostQueryVariables = Exact<{
|
||||
relativePath: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -778,6 +908,21 @@ export type TheaterHomepageConnectionQueryVariables = Exact<{
|
||||
|
||||
export type TheaterHomepageConnectionQuery = { __typename?: 'Query', theaterHomepageConnection: { __typename?: 'TheaterHomepageConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'TheaterHomepageConnectionEdges', cursor: string, node?: { __typename: 'TheaterHomepage', id: string, title: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, hero?: { __typename: 'TheaterHomepageHero', title_de: string, title_en: string, subtitle_de: string, subtitle_en: string } | null, projekt?: { __typename: 'TheaterHomepageProjekt', title_de: string, title_en: string, content_de: any, content_en: any } | null, team?: { __typename: 'TheaterHomepageTeam', title_de: string, title_en: string, content_de: any, content_en: any, organizations?: Array<{ __typename: 'TheaterHomepageTeamOrganizations', name?: string | null, role_de?: string | null, role_en?: string | null, logo?: string | null, url?: string | null } | null> | null } | null, stueck?: { __typename: 'TheaterHomepageStueck', title_de: string, title_en: string, content_de: any, content_en: any } | null, mitwirkung?: { __typename: 'TheaterHomepageMitwirkung', title_de: string, title_en: string, content_de: any, content_en: any, director_name?: string | null, director_email?: string | null, director_phone?: string | null } | null, termine?: { __typename: 'TheaterHomepageTermine', title_de: string, title_en: string, events?: Array<{ __typename: 'TheaterHomepageTermineEvents', title_de?: string | null, title_en?: string | null, date?: string | null, description_de?: string | null, description_en?: string | null } | null> | null } | null, presse?: { __typename: 'TheaterHomepagePresse', title_de: string, title_en: string, content_de: any, content_en: any } | null, gallery?: { __typename: 'TheaterHomepageGallery', title_de: string, title_en: string, images?: Array<string | null> | null } | null, tickets?: { __typename: 'TheaterHomepageTickets', title_de: string, title_en: string, content_de: any, content_en: any, ticket_url?: string | null } | null } | null } | null> | null } };
|
||||
|
||||
export const UserPartsFragmentDoc = gql`
|
||||
fragment UserParts on User {
|
||||
__typename
|
||||
users {
|
||||
__typename
|
||||
username
|
||||
name
|
||||
email
|
||||
password {
|
||||
value
|
||||
passwordChangeRequired
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const PostPartsFragmentDoc = gql`
|
||||
fragment PostParts on Post {
|
||||
__typename
|
||||
@@ -882,6 +1027,63 @@ export const TheaterHomepagePartsFragmentDoc = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const UserDocument = gql`
|
||||
query user($relativePath: String!) {
|
||||
user(relativePath: $relativePath) {
|
||||
... on Document {
|
||||
_sys {
|
||||
filename
|
||||
basename
|
||||
hasReferences
|
||||
breadcrumbs
|
||||
path
|
||||
relativePath
|
||||
extension
|
||||
}
|
||||
id
|
||||
}
|
||||
...UserParts
|
||||
}
|
||||
}
|
||||
${UserPartsFragmentDoc}`;
|
||||
export const UserConnectionDocument = gql`
|
||||
query userConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: UserFilter) {
|
||||
userConnection(
|
||||
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
|
||||
}
|
||||
...UserParts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${UserPartsFragmentDoc}`;
|
||||
export const PostDocument = gql`
|
||||
query post($relativePath: String!) {
|
||||
post(relativePath: $relativePath) {
|
||||
@@ -1056,7 +1258,13 @@ export const TheaterHomepageConnectionDocument = gql`
|
||||
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, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostQueryVariables, query: string}> {
|
||||
user(variables: UserQueryVariables, options?: C): Promise<{data: UserQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: UserQueryVariables, query: string}> {
|
||||
return requester<{data: UserQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: UserQueryVariables, query: string}, UserQueryVariables>(UserDocument, variables, options);
|
||||
},
|
||||
userConnection(variables?: UserConnectionQueryVariables, options?: C): Promise<{data: UserConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: UserConnectionQueryVariables, query: string}> {
|
||||
return requester<{data: UserConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: UserConnectionQueryVariables, query: string}, UserConnectionQueryVariables>(UserConnectionDocument, variables, options);
|
||||
},
|
||||
post(variables: PostQueryVariables, options?: C): Promise<{data: PostQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostQueryVariables, query: string}> {
|
||||
return requester<{data: PostQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostQueryVariables, query: string}, PostQueryVariables>(PostDocument, variables, options);
|
||||
},
|
||||
postConnection(variables?: PostConnectionQueryVariables, options?: C): Promise<{data: PostConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: PostConnectionQueryVariables, query: string}> {
|
||||
@@ -1121,7 +1329,7 @@ export const ExperimentalGetTinaClient = () =>
|
||||
getSdk(
|
||||
generateRequester(
|
||||
createClient({
|
||||
url: "http://localhost:4001/graphql",
|
||||
url: "/api/tina/gql",
|
||||
queries,
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user