import { gql } from '@apollo/client' ; import * as Apollo from '@apollo/client' ; export type Maybe < T > = T | null ; export type Exact < T extends { [ key ] : unknown ; } > = { [ K in keyof T ] : T [ K ] ; } ; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID : string ; String : string ; Boolean : boolean ; Int : number ; Float : number ; } ; export type Query = { __typename ? : 'Query' ; hello : Scalars [ 'String' ] ; posts : PaginatedPosts ; post ? : Maybe < Post > ; me ? : Maybe < User > ; } ; export type QueryPostsArgs = { cursor ? : Maybe < Scalars [ 'String' ] > ; limit : Scalars [ 'Int' ] ; } ; export type QueryPostArgs = { id : Scalars [ 'Int' ] ; } ; export type PaginatedPosts = { __typename ? : 'PaginatedPosts' ; posts : Array < Post > ; hasMore : Scalars [ 'Boolean' ] ; } ; export type Post = { __typename ? : 'Post' ; id : Scalars [ 'Float' ] ; title : Scalars [ 'String' ] ; text : Scalars [ 'String' ] ; points : Scalars [ 'Float' ] ; voteStatus ? : Maybe < Scalars [ 'Int' ] > ; creatorId : Scalars [ 'Float' ] ; creator : User ; createdAt : Scalars [ 'String' ] ; updatedAt : Scalars [ 'String' ] ; textSnippet : Scalars [ 'String' ] ; } ; export type User = { __typename ? : 'User' ; id : Scalars [ 'Float' ] ; username : Scalars [ 'String' ] ; email : Scalars [ 'String' ] ; createdAt : Scalars [ 'String' ] ; updatedAt : Scalars [ 'String' ] ; } ; export type Mutation = { __typename ? : 'Mutation' ; vote : Scalars [ 'Boolean' ] ; createPost : Post ; updatePost ? : Maybe < Post > ; deletePost : Scalars [ 'Boolean' ] ; changePassword : UserResponse ; forgotPassword : Scalars [ 'Boolean' ] ; register : UserResponse ; login : UserResponse ; logout : Scalars [ 'Boolean' ] ; } ; export type MutationVoteArgs = { value : Scalars [ 'Int' ] ; postId : Scalars [ 'Int' ] ; } ; export type MutationCreatePostArgs = { input : PostInput ; } ; export type MutationUpdatePostArgs = { text : Scalars [ 'String' ] ; title : Scalars [ 'String' ] ; id : Scalars [ 'Int' ] ; } ; export type MutationDeletePostArgs = { id : Scalars [ 'Int' ] ; } ; export type MutationChangePasswordArgs = { newPassword : Scalars [ 'String' ] ; token : Scalars [ 'String' ] ; } ; export type MutationForgotPasswordArgs = { email : Scalars [ 'String' ] ; } ; export type MutationRegisterArgs = { options : UsernamePasswordInput ; } ; export type MutationLoginArgs = { password : Scalars [ 'String' ] ; usernameOrEmail : Scalars [ 'String' ] ; } ; export type PostInput = { title : Scalars [ 'String' ] ; text : Scalars [ 'String' ] ; } ; export type UserResponse = { __typename ? : 'UserResponse' ; errors ? : Maybe < Array < FieldError > > ; user ? : Maybe < User > ; } ; export type FieldError = { __typename ? : 'FieldError' ; field : Scalars [ 'String' ] ; message : Scalars [ 'String' ] ; } ; export type UsernamePasswordInput = { email : Scalars [ 'String' ] ; username : Scalars [ 'String' ] ; password : Scalars [ 'String' ] ; } ; export type PostSnippetFragment = ( { __typename ? : 'Post' ; } & Pick < Post , 'id' | 'createdAt' | 'updatedAt' | 'title' | 'points' | 'textSnippet' | 'voteStatus' > & { creator : ( { __typename ? : 'User' ; } & Pick < User , 'id' | 'username' > ) ; } ) ; export type RegularErrorFragment = ( { __typename ? : 'FieldError' ; } & Pick < FieldError , 'field' | 'message' > ) ; export type RegularUserFragment = ( { __typename ? : 'User' ; } & Pick < User , 'id' | 'username' > ) ; export type RegularUserResponseFragment = ( { __typename ? : 'UserResponse' ; } & { errors ? : Maybe < Array < ( { __typename ? : 'FieldError' ; } & RegularErrorFragment ) > > ; user ? : Maybe < ( { __typename ? : 'User' ; } & RegularUserFragment ) > ; } ) ; export type ChangePasswordMutationVariables = Exact < { token : Scalars [ 'String' ] ; newPassword : Scalars [ 'String' ] ; } > ; export type ChangePasswordMutation = ( { __typename ? : 'Mutation' ; } & { changePassword : ( { __typename ? : 'UserResponse' ; } & RegularUserResponseFragment ) ; } ) ; export type CreatePostMutationVariables = Exact < { input : PostInput ; } > ; export type CreatePostMutation = ( { __typename ? : 'Mutation' ; } & { createPost : ( { __typename ? : 'Post' ; } & Pick < Post , 'id' | 'createdAt' | 'updatedAt' | 'title' | 'text' | 'points' | 'creatorId' > ) ; } ) ; export type DeletePostMutationVariables = Exact < { id : Scalars [ 'Int' ] ; } > ; export type DeletePostMutation = ( { __typename ? : 'Mutation' ; } & Pick < Mutation , 'deletePost' > ) ; export type ForgotPasswordMutationVariables = Exact < { email : Scalars [ 'String' ] ; } > ; export type ForgotPasswordMutation = ( { __typename ? : 'Mutation' ; } & Pick < Mutation , 'forgotPassword' > ) ; export type LoginMutationVariables = Exact < { usernameOrEmail : Scalars [ 'String' ] ; password : Scalars [ 'String' ] ; } > ; export type LoginMutation = ( { __typename ? : 'Mutation' ; } & { login : ( { __typename ? : 'UserResponse' ; } & RegularUserResponseFragment ) ; } ) ; export type LogoutMutationVariables = Exact < { [ key ] : never ; } > ; export type LogoutMutation = ( { __typename ? : 'Mutation' ; } & Pick < Mutation , 'logout' > ) ; export type RegisterMutationVariables = Exact < { options : UsernamePasswordInput ; } > ; export type RegisterMutation = ( { __typename ? : 'Mutation' ; } & { register : ( { __typename ? : 'UserResponse' ; } & RegularUserResponseFragment ) ; } ) ; export type UpdatePostMutationVariables = Exact < { id : Scalars [ 'Int' ] ; title : Scalars [ 'String' ] ; text : Scalars [ 'String' ] ; } > ; export type UpdatePostMutation = ( { __typename ? : 'Mutation' ; } & { updatePost ? : Maybe < ( { __typename ? : 'Post' ; } & Pick < Post , 'id' | 'title' | 'text' | 'textSnippet' > ) > ; } ) ; export type VoteMutationVariables = Exact < { value : Scalars [ 'Int' ] ; postId : Scalars [ 'Int' ] ; } > ; export type VoteMutation = ( { __typename ? : 'Mutation' ; } & Pick < Mutation , 'vote' > ) ; export type MeQueryVariables = Exact < { [ key ] : never ; } > ; export type MeQuery = ( { __typename ? : 'Query' ; } & { me ? : Maybe < ( { __typename ? : 'User' ; } & RegularUserFragment ) > ; } ) ; export type PostQueryVariables = Exact < { id : Scalars [ 'Int' ] ; } > ; export type PostQuery = ( { __typename ? : 'Query' ; } & { post ? : Maybe < ( { __typename ? : 'Post' ; } & Pick < Post , 'id' | 'createdAt' | 'updatedAt' | 'title' | 'points' | 'text' | 'voteStatus' > & { creator : ( { __typename ? : 'User' ; } & Pick < User , 'id' | 'username' > ) ; } ) > ; } ) ; export type PostsQueryVariables = Exact < { limit : Scalars [ 'Int' ] ; cursor ? : Maybe < Scalars [ 'String' ] > ; } > ; export type PostsQuery = ( { __typename ? : 'Query' ; } & { posts : ( { __typename ? : 'PaginatedPosts' ; } & Pick < PaginatedPosts , 'hasMore' > & { posts : Array < ( { __typename ? : 'Post' ; } & PostSnippetFragment ) > ; } ) ; } ) ; export const PostSnippetFragmentDoc = gql `
    fragment PostSnippet on Post {
  id
  createdAt
  updatedAt
  title
  points
  textSnippet
  voteStatus
  creator {
    id
    username
  }
}
    ` ; export const RegularErrorFragmentDoc = gql `
    fragment RegularError on FieldError {
  field
  message
}
    ` ; export const RegularUserFragmentDoc = gql `
    fragment RegularUser on User {
  id
  username
}
    ` ; export const RegularUserResponseFragmentDoc = gql `
    fragment RegularUserResponse on UserResponse {
  errors {
    ...RegularError
  }
  user {
    ...RegularUser
  }
}
    ${ RegularErrorFragmentDoc }
${ RegularUserFragmentDoc }` ; export const ChangePasswordDocument = gql `
    mutation ChangePassword($token: String!, $newPassword: String!) {
  changePassword(token: $token, newPassword: $newPassword) {
    ...RegularUserResponse
  }
}
    ${ RegularUserResponseFragmentDoc }` ; export type ChangePasswordMutationFn = Apollo . MutationFunction < ChangePasswordMutation , ChangePasswordMutationVariables > ; param baseOptions example export function useChangePasswordMutation ( baseOptions ? ) { return Apollo . useMutation < ChangePasswordMutation , ChangePasswordMutationVariables > ( ChangePasswordDocument , baseOptions ) ; } export type ChangePasswordMutationHookResult = ReturnType < typeof useChangePasswordMutation > ; export type ChangePasswordMutationResult = Apollo . MutationResult < ChangePasswordMutation > ; export type ChangePasswordMutationOptions = Apollo . BaseMutationOptions < ChangePasswordMutation , ChangePasswordMutationVariables > ; export const CreatePostDocument = gql `
    mutation CreatePost($input: PostInput!) {
  createPost(input: $input) {
    id
    createdAt
    updatedAt
    title
    text
    points
    creatorId
  }
}
    ` ; export type CreatePostMutationFn = Apollo . MutationFunction < CreatePostMutation , CreatePostMutationVariables > ; param baseOptions example export function useCreatePostMutation ( baseOptions ? ) { return Apollo . useMutation < CreatePostMutation , CreatePostMutationVariables > ( CreatePostDocument , baseOptions ) ; } export type CreatePostMutationHookResult = ReturnType < typeof useCreatePostMutation > ; export type CreatePostMutationResult = Apollo . MutationResult < CreatePostMutation > ; export type CreatePostMutationOptions = Apollo . BaseMutationOptions < CreatePostMutation , CreatePostMutationVariables > ; export const DeletePostDocument = gql `
    mutation DeletePost($id: Int!) {
  deletePost(id: $id)
}
    ` ; export type DeletePostMutationFn = Apollo . MutationFunction < DeletePostMutation , DeletePostMutationVariables > ; param baseOptions example export function useDeletePostMutation ( baseOptions ? ) { return Apollo . useMutation < DeletePostMutation , DeletePostMutationVariables > ( DeletePostDocument , baseOptions ) ; } export type DeletePostMutationHookResult = ReturnType < typeof useDeletePostMutation > ; export type DeletePostMutationResult = Apollo . MutationResult < DeletePostMutation > ; export type DeletePostMutationOptions = Apollo . BaseMutationOptions < DeletePostMutation , DeletePostMutationVariables > ; export const ForgotPasswordDocument = gql `
    mutation ForgotPassword($email: String!) {
  forgotPassword(email: $email)
}
    ` ; export type ForgotPasswordMutationFn = Apollo . MutationFunction < ForgotPasswordMutation , ForgotPasswordMutationVariables > ; param baseOptions example export function useForgotPasswordMutation ( baseOptions ? ) { return Apollo . useMutation < ForgotPasswordMutation , ForgotPasswordMutationVariables > ( ForgotPasswordDocument , baseOptions ) ; } export type ForgotPasswordMutationHookResult = ReturnType < typeof useForgotPasswordMutation > ; export type ForgotPasswordMutationResult = Apollo . MutationResult < ForgotPasswordMutation > ; export type ForgotPasswordMutationOptions = Apollo . BaseMutationOptions < ForgotPasswordMutation , ForgotPasswordMutationVariables > ; export const LoginDocument = gql `
    mutation Login($usernameOrEmail: String!, $password: String!) {
  login(usernameOrEmail: $usernameOrEmail, password: $password) {
    ...RegularUserResponse
  }
}
    ${ RegularUserResponseFragmentDoc }` ; export type LoginMutationFn = Apollo . MutationFunction < LoginMutation , LoginMutationVariables > ; param baseOptions example export function useLoginMutation ( baseOptions ? ) { return Apollo . useMutation < LoginMutation , LoginMutationVariables > ( LoginDocument , baseOptions ) ; } export type LoginMutationHookResult = ReturnType < typeof useLoginMutation > ; export type LoginMutationResult = Apollo . MutationResult < LoginMutation > ; export type LoginMutationOptions = Apollo . BaseMutationOptions < LoginMutation , LoginMutationVariables > ; export const LogoutDocument = gql `
    mutation Logout {
  logout
}
    ` ; export type LogoutMutationFn = Apollo . MutationFunction < LogoutMutation , LogoutMutationVariables > ; param baseOptions example export function useLogoutMutation ( baseOptions ? ) { return Apollo . useMutation < LogoutMutation , LogoutMutationVariables > ( LogoutDocument , baseOptions ) ; } export type LogoutMutationHookResult = ReturnType < typeof useLogoutMutation > ; export type LogoutMutationResult = Apollo . MutationResult < LogoutMutation > ; export type LogoutMutationOptions = Apollo . BaseMutationOptions < LogoutMutation , LogoutMutationVariables > ; export const RegisterDocument = gql `
    mutation Register($options: UsernamePasswordInput!) {
  register(options: $options) {
    ...RegularUserResponse
  }
}
    ${ RegularUserResponseFragmentDoc }` ; export type RegisterMutationFn = Apollo . MutationFunction < RegisterMutation , RegisterMutationVariables > ; param baseOptions example export function useRegisterMutation ( baseOptions ? ) { return Apollo . useMutation < RegisterMutation , RegisterMutationVariables > ( RegisterDocument , baseOptions ) ; } export type RegisterMutationHookResult = ReturnType < typeof useRegisterMutation > ; export type RegisterMutationResult = Apollo . MutationResult < RegisterMutation > ; export type RegisterMutationOptions = Apollo . BaseMutationOptions < RegisterMutation , RegisterMutationVariables > ; export const UpdatePostDocument = gql `
    mutation UpdatePost($id: Int!, $title: String!, $text: String!) {
  updatePost(id: $id, title: $title, text: $text) {
    id
    title
    text
    textSnippet
  }
}
    ` ; export type UpdatePostMutationFn = Apollo . MutationFunction < UpdatePostMutation , UpdatePostMutationVariables > ; param baseOptions example export function useUpdatePostMutation ( baseOptions ? ) { return Apollo . useMutation < UpdatePostMutation , UpdatePostMutationVariables > ( UpdatePostDocument , baseOptions ) ; } export type UpdatePostMutationHookResult = ReturnType < typeof useUpdatePostMutation > ; export type UpdatePostMutationResult = Apollo . MutationResult < UpdatePostMutation > ; export type UpdatePostMutationOptions = Apollo . BaseMutationOptions < UpdatePostMutation , UpdatePostMutationVariables > ; export const VoteDocument = gql `
    mutation Vote($value: Int!, $postId: Int!) {
  vote(value: $value, postId: $postId)
}
    ` ; export type VoteMutationFn = Apollo . MutationFunction < VoteMutation , VoteMutationVariables > ; param baseOptions example export function useVoteMutation ( baseOptions ? ) { return Apollo . useMutation < VoteMutation , VoteMutationVariables > ( VoteDocument , baseOptions ) ; } export type VoteMutationHookResult = ReturnType < typeof useVoteMutation > ; export type VoteMutationResult = Apollo . MutationResult < VoteMutation > ; export type VoteMutationOptions = Apollo . BaseMutationOptions < VoteMutation , VoteMutationVariables > ; export const MeDocument = gql `
    query Me {
  me {
    ...RegularUser
  }
}
    ${ RegularUserFragmentDoc }` ; param baseOptions example export function useMeQuery ( baseOptions ? ) { return Apollo . useQuery < MeQuery , MeQueryVariables > ( MeDocument , baseOptions ) ; } export function useMeLazyQuery ( baseOptions ? ) { return Apollo . useLazyQuery < MeQuery , MeQueryVariables > ( MeDocument , baseOptions ) ; } export type MeQueryHookResult = ReturnType < typeof useMeQuery > ; export type MeLazyQueryHookResult = ReturnType < typeof useMeLazyQuery > ; export type MeQueryResult = Apollo . QueryResult < MeQuery , MeQueryVariables > ; export const PostDocument = gql `
    query Post($id: Int!) {
  post(id: $id) {
    id
    createdAt
    updatedAt
    title
    points
    text
    voteStatus
    creator {
      id
      username
    }
  }
}
    ` ; param baseOptions example export function usePostQuery ( baseOptions ? ) { return Apollo . useQuery < PostQuery , PostQueryVariables > ( PostDocument , baseOptions ) ; } export function usePostLazyQuery ( baseOptions ? ) { return Apollo . useLazyQuery < PostQuery , PostQueryVariables > ( PostDocument , baseOptions ) ; } export type PostQueryHookResult = ReturnType < typeof usePostQuery > ; export type PostLazyQueryHookResult = ReturnType < typeof usePostLazyQuery > ; export type PostQueryResult = Apollo . QueryResult < PostQuery , PostQueryVariables > ; export const PostsDocument = gql `
    query Posts($limit: Int!, $cursor: String) {
  posts(limit: $limit, cursor: $cursor) {
    hasMore
    posts {
      ...PostSnippet
    }
  }
}
    ${ PostSnippetFragmentDoc }` ; param baseOptions example export function usePostsQuery ( baseOptions ? ) { return Apollo . useQuery < PostsQuery , PostsQueryVariables > ( PostsDocument , baseOptions ) ; } export function usePostsLazyQuery ( baseOptions ? ) { return Apollo . useLazyQuery < PostsQuery , PostsQueryVariables > ( PostsDocument , baseOptions ) ; } export type PostsQueryHookResult = ReturnType < typeof usePostsQuery > ; export type PostsLazyQueryHookResult = ReturnType < typeof usePostsLazyQuery > ; export type PostsQueryResult = Apollo . QueryResult < PostsQuery , PostsQueryVariables > ;