feat: add getProject by hashtag api, change the project page to use hashtag, update mocks

This commit is contained in:
MTG2000
2022-09-29 12:34:51 +03:00
parent f250a32667
commit bfc35cb6e5
12 changed files with 274 additions and 262 deletions

View File

@@ -1286,7 +1286,8 @@ export interface NexusGenArgTypes {
type: NexusGenEnums['POST_TYPE']; // POST_TYPE!
}
getProject: { // args
id: number; // Int!
id?: number | null; // Int
tag?: string | null; // String
}
getProjectsInTournament: { // args
roleId?: number | null; // Int

View File

@@ -342,7 +342,7 @@ type Query {
getMakersInTournament(openToConnect: Boolean, roleId: Int, search: String, skip: Int = 0, take: Int = 10, tournamentId: Int!): TournamentMakersResponse!
getMyDrafts(type: POST_TYPE!): [Post!]!
getPostById(id: Int!, type: POST_TYPE!): Post!
getProject(id: Int!): Project!
getProject(id: Int, tag: String): Project!
getProjectsInTournament(roleId: Int, search: String, skip: Int = 0, take: Int = 10, tournamentId: Int!): TournamentProjectsResponse!
getTournamentById(id: Int!): Tournament!
getTournamentToRegister: [Tournament!]!

View File

@@ -273,9 +273,11 @@ const getProject = extendType({
t.nonNull.field('getProject', {
type: "Project",
args: {
id: nonNull(intArg())
id: intArg(),
tag: stringArg(),
},
resolve(_, { id }) {
resolve(_, { id, tag }) {
if (tag) return prisma.project.findFirst({ where: { hashtag: tag } })
return prisma.project.findUnique({
where: { id }
})

View File

@@ -69,7 +69,9 @@ async function main() {
// await migrateOldImages();
await createCapabilities();
// await createCapabilities();
// await createHashtags();
}
async function migrateOldImages() {
@@ -238,7 +240,7 @@ async function migrateOldImages() {
/**
* Tournament
**/
const tournaments = await prisma.tournament.findMany({
const tournaments = await prisma.tournament.findMany({
select: {
id: true,
thumbnail_image: true,
@@ -263,7 +265,7 @@ async function migrateOldImages() {
/**
* TournamentPrize
**/
const tournamentPrizes = await prisma.tournamentPrize.findMany({
const tournamentPrizes = await prisma.tournamentPrize.findMany({
select: {
id: true,
image: true,
@@ -508,6 +510,24 @@ async function createCapabilities() {
})
}
async function createHashtags() {
console.log("Creating Hashtags for projects");
const projects = await prisma.project.findMany({ select: { title: true, id: true } });
for (let i = 0; i < projects.length; i++) {
const project = projects[i];
await prisma.project.update({
where: { id: project.id },
data: {
hashtag: project.title.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, '')
.replace(/[\s_-]+/g, '_')
.replace(/^-+|-+$/g, '')
}
})
}
}
main()
.catch((e) => {

View File

@@ -143,7 +143,8 @@ export default function FormContainer(props: PropsWithChildren<Props>) {
const query = useProjectDetailsQuery({
variables: {
projectId: id!
projectId: id!,
projectTag: null,
},
skip: !isUpdating,
onCompleted: (res) => {

View File

@@ -4,7 +4,7 @@ import { MdLocalFireDepartment } from 'react-icons/md'
import Button from 'src/Components/Button/Button'
import Card from 'src/Components/Card/Card'
import Lightbox from 'src/Components/Lightbox/Lightbox'
import { ProjectDetailsQuery, ProjectLaunchStatusEnum, } from 'src/graphql'
import { ProjectDetailsQuery, ProjectLaunchStatusEnum, ProjectPermissionEnum, } from 'src/graphql'
import { openModal } from 'src/redux/features/modals.slice'
import { setVoteAmount } from 'src/redux/features/vote.slice'
import { numberFormatter } from 'src/utils/helperFunctions'
@@ -45,6 +45,9 @@ export default function AboutCard({ project }: Props) {
}))
}
const canEdit = project.permissions.includes(ProjectPermissionEnum.UpdateInfo);
return (
<Card defaultPadding={false}>
{/* Cover Image */}
@@ -62,7 +65,7 @@ export default function AboutCard({ project }: Props) {
{/* Title & Basic Info */}
<div className="flex flex-col gap-24 relative">
<div className="flex flex-wrap justify-end items-center gap-16">
<Button size="sm" color="gray" href={createRoute({ type: "edit-project", id: project.id })}>Edit Project</Button>
{canEdit && <Button size="sm" color="gray" href={createRoute({ type: "edit-project", id: project.id })}>Edit Project</Button>}
<Button size="sm" variant='outline' color='gray' className='w-full md:w-auto' onClick={() => onVote()}>
<MdLocalFireDepartment />{<span className="align-middle w-[4ch]"> {numberFormatter(project.votes_count)}</span>}
</Button>

View File

@@ -1,5 +1,5 @@
query ProjectDetails($projectId: Int!) {
getProject(id: $projectId) {
query ProjectDetails($projectId: Int, $projectTag: String) {
getProject(id: $projectId, tag: $projectTag) {
id
title
tagline

View File

@@ -41,7 +41,7 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
const isMdScreen = useMediaQuery(MEDIA_QUERIES.isMedium)
const { data, loading, error } = useProjectDetailsQuery({
variables: { projectId: projectId! },
variables: { projectId: projectId!, projectTag: null },
onCompleted: data => {
dispatch(setProject(data.getProject))
},
@@ -69,9 +69,6 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
if (loading || !data?.getProject)
return <ProjectCardSkeleton onClose={closeModal} direction={direction} isPageModal={props.isPageModal} />;
const onConnectWallet = async () => {
Wallet_Service.connectWallet()
}
const project = data.getProject;
@@ -105,10 +102,6 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
},
];
const canEdit = project.permissions.includes(ProjectPermissionEnum.UpdateInfo);
const onVote = (votes?: number) => {
dispatch(setVoteAmount(votes ?? 10));
dispatch(openModal({
@@ -119,21 +112,6 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
}))
}
const onClaim = () => {
if (!isWalletConnected) {
dispatch(scheduleModal({
Modal: 'Claim_GenerateSignatureCard',
}))
dispatch(openModal({
Modal: 'Login_ScanningWalletCard'
}))
} else
dispatch(openModal({
Modal: 'Claim_GenerateSignatureCard',
}))
}
return (
<div
className={`modal-card max-w-[676px] ${(props.isPageModal && !isMdScreen) && '!rounded-0 w-full min-h-screen'}`}
@@ -241,15 +219,16 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
/>
</>}
{project.capabilities.length > 0 &&
{/* {project.capabilities.length > 0 &&
<div>
<p className="text-body6 uppercase font-medium text-gray-400 mb-8">CAPABILITIES</p>
<div className="flex flex-wrap gap-8">
{project.capabilities.map(cap => <Badge key={cap.id} size='sm'>{cap.icon} {cap.title}</Badge>)}
</div>
</div>}
<hr className="" />
{project.members.length > 0 &&
*/}
<Button color='gray' fullWidth href={createRoute({ type: "project", tag: project.hashtag })} onClick={props.onClose}>Show More</Button>
{/* {project.members.length > 0 &&
<div>
<p className="text-body6 uppercase font-medium text-gray-400 mb-8">MAKERS</p>
<div className="flex flex-wrap gap-8">
@@ -267,7 +246,7 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
/>
</Link>)}
</div>
</div>}
</div>} */}
{/* <div className="text-center">
<h3 className="text-body4 font-regular">Are you the creator of this project</h3>
<Button

View File

@@ -22,7 +22,7 @@ export default function ProjectPage() {
const dispatch = useAppDispatch();
const { data, loading, error } = useProjectDetailsQuery({
variables: { projectId: Number(tag!) },
variables: { projectId: null, projectTag: tag! },
onCompleted: data => {
dispatch(setProject(data.getProject))
},

View File

@@ -538,7 +538,8 @@ export type QueryGetPostByIdArgs = {
export type QueryGetProjectArgs = {
id: Scalars['Int'];
id: InputMaybe<Scalars['Int']>;
tag: InputMaybe<Scalars['String']>;
};
@@ -1072,7 +1073,8 @@ export type GetTournamentsToRegisterQueryVariables = Exact<{ [key: string]: neve
export type GetTournamentsToRegisterQuery = { __typename?: 'Query', getTournamentToRegister: Array<{ __typename?: 'Tournament', id: number, title: string }> };
export type ProjectDetailsQueryVariables = Exact<{
projectId: Scalars['Int'];
projectId: InputMaybe<Scalars['Int']>;
projectTag: InputMaybe<Scalars['String']>;
}>;
@@ -1269,13 +1271,13 @@ export const OfficialTagsDocument = gql`
* });
*/
export function useOfficialTagsQuery(baseOptions?: Apollo.QueryHookOptions<OfficialTagsQuery, OfficialTagsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<OfficialTagsQuery, OfficialTagsQueryVariables>(OfficialTagsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<OfficialTagsQuery, OfficialTagsQueryVariables>(OfficialTagsDocument, options);
}
export function useOfficialTagsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<OfficialTagsQuery, OfficialTagsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<OfficialTagsQuery, OfficialTagsQueryVariables>(OfficialTagsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<OfficialTagsQuery, OfficialTagsQueryVariables>(OfficialTagsDocument, options);
}
export type OfficialTagsQueryHookResult = ReturnType<typeof useOfficialTagsQuery>;
export type OfficialTagsLazyQueryHookResult = ReturnType<typeof useOfficialTagsLazyQuery>;
export type OfficialTagsQueryResult = Apollo.QueryResult<OfficialTagsQuery, OfficialTagsQueryVariables>;
@@ -1307,13 +1309,13 @@ export const SearchUsersDocument = gql`
* });
*/
export function useSearchUsersQuery(baseOptions: Apollo.QueryHookOptions<SearchUsersQuery, SearchUsersQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<SearchUsersQuery, SearchUsersQueryVariables>(SearchUsersDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<SearchUsersQuery, SearchUsersQueryVariables>(SearchUsersDocument, options);
}
export function useSearchUsersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<SearchUsersQuery, SearchUsersQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<SearchUsersQuery, SearchUsersQueryVariables>(SearchUsersDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<SearchUsersQuery, SearchUsersQueryVariables>(SearchUsersDocument, options);
}
export type SearchUsersQueryHookResult = ReturnType<typeof useSearchUsersQuery>;
export type SearchUsersLazyQueryHookResult = ReturnType<typeof useSearchUsersLazyQuery>;
export type SearchUsersQueryResult = Apollo.QueryResult<SearchUsersQuery, SearchUsersQueryVariables>;
@@ -1344,13 +1346,13 @@ export const NavCategoriesDocument = gql`
* });
*/
export function useNavCategoriesQuery(baseOptions?: Apollo.QueryHookOptions<NavCategoriesQuery, NavCategoriesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<NavCategoriesQuery, NavCategoriesQueryVariables>(NavCategoriesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<NavCategoriesQuery, NavCategoriesQueryVariables>(NavCategoriesDocument, options);
}
export function useNavCategoriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<NavCategoriesQuery, NavCategoriesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<NavCategoriesQuery, NavCategoriesQueryVariables>(NavCategoriesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<NavCategoriesQuery, NavCategoriesQueryVariables>(NavCategoriesDocument, options);
}
export type NavCategoriesQueryHookResult = ReturnType<typeof useNavCategoriesQuery>;
export type NavCategoriesLazyQueryHookResult = ReturnType<typeof useNavCategoriesLazyQuery>;
export type NavCategoriesQueryResult = Apollo.QueryResult<NavCategoriesQuery, NavCategoriesQueryVariables>;
@@ -1385,13 +1387,13 @@ export const SearchProjectsDocument = gql`
* });
*/
export function useSearchProjectsQuery(baseOptions: Apollo.QueryHookOptions<SearchProjectsQuery, SearchProjectsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<SearchProjectsQuery, SearchProjectsQueryVariables>(SearchProjectsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<SearchProjectsQuery, SearchProjectsQueryVariables>(SearchProjectsDocument, options);
}
export function useSearchProjectsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<SearchProjectsQuery, SearchProjectsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<SearchProjectsQuery, SearchProjectsQueryVariables>(SearchProjectsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<SearchProjectsQuery, SearchProjectsQueryVariables>(SearchProjectsDocument, options);
}
export type SearchProjectsQueryHookResult = ReturnType<typeof useSearchProjectsQuery>;
export type SearchProjectsLazyQueryHookResult = ReturnType<typeof useSearchProjectsLazyQuery>;
export type SearchProjectsQueryResult = Apollo.QueryResult<SearchProjectsQuery, SearchProjectsQueryVariables>;
@@ -1424,13 +1426,13 @@ export const MeDocument = gql`
* });
*/
export function useMeQuery(baseOptions?: Apollo.QueryHookOptions<MeQuery, MeQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<MeQuery, MeQueryVariables>(MeDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MeQuery, MeQueryVariables>(MeDocument, options);
}
export function useMeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MeQuery, MeQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<MeQuery, MeQueryVariables>(MeDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MeQuery, MeQueryVariables>(MeDocument, options);
}
export type MeQueryHookResult = ReturnType<typeof useMeQuery>;
export type MeLazyQueryHookResult = ReturnType<typeof useMeLazyQuery>;
export type MeQueryResult = Apollo.QueryResult<MeQuery, MeQueryVariables>;
@@ -1461,13 +1463,13 @@ export const DonationsStatsDocument = gql`
* });
*/
export function useDonationsStatsQuery(baseOptions?: Apollo.QueryHookOptions<DonationsStatsQuery, DonationsStatsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<DonationsStatsQuery, DonationsStatsQueryVariables>(DonationsStatsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<DonationsStatsQuery, DonationsStatsQueryVariables>(DonationsStatsDocument, options);
}
export function useDonationsStatsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DonationsStatsQuery, DonationsStatsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<DonationsStatsQuery, DonationsStatsQueryVariables>(DonationsStatsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<DonationsStatsQuery, DonationsStatsQueryVariables>(DonationsStatsDocument, options);
}
export type DonationsStatsQueryHookResult = ReturnType<typeof useDonationsStatsQuery>;
export type DonationsStatsLazyQueryHookResult = ReturnType<typeof useDonationsStatsLazyQuery>;
export type DonationsStatsQueryResult = Apollo.QueryResult<DonationsStatsQuery, DonationsStatsQueryVariables>;
@@ -1501,9 +1503,9 @@ export type DonateMutationFn = Apollo.MutationFunction<DonateMutation, DonateMut
* });
*/
export function useDonateMutation(baseOptions?: Apollo.MutationHookOptions<DonateMutation, DonateMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<DonateMutation, DonateMutationVariables>(DonateDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<DonateMutation, DonateMutationVariables>(DonateDocument, options);
}
export type DonateMutationHookResult = ReturnType<typeof useDonateMutation>;
export type DonateMutationResult = Apollo.MutationResult<DonateMutation>;
export type DonateMutationOptions = Apollo.BaseMutationOptions<DonateMutation, DonateMutationVariables>;
@@ -1537,9 +1539,9 @@ export type ConfirmDonationMutationFn = Apollo.MutationFunction<ConfirmDonationM
* });
*/
export function useConfirmDonationMutation(baseOptions?: Apollo.MutationHookOptions<ConfirmDonationMutation, ConfirmDonationMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<ConfirmDonationMutation, ConfirmDonationMutationVariables>(ConfirmDonationDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<ConfirmDonationMutation, ConfirmDonationMutationVariables>(ConfirmDonationDocument, options);
}
export type ConfirmDonationMutationHookResult = ReturnType<typeof useConfirmDonationMutation>;
export type ConfirmDonationMutationResult = Apollo.MutationResult<ConfirmDonationMutation>;
export type ConfirmDonationMutationOptions = Apollo.BaseMutationOptions<ConfirmDonationMutation, ConfirmDonationMutationVariables>;
@@ -1581,13 +1583,13 @@ export const GetHackathonsDocument = gql`
* });
*/
export function useGetHackathonsQuery(baseOptions?: Apollo.QueryHookOptions<GetHackathonsQuery, GetHackathonsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetHackathonsQuery, GetHackathonsQueryVariables>(GetHackathonsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetHackathonsQuery, GetHackathonsQueryVariables>(GetHackathonsDocument, options);
}
export function useGetHackathonsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetHackathonsQuery, GetHackathonsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetHackathonsQuery, GetHackathonsQueryVariables>(GetHackathonsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetHackathonsQuery, GetHackathonsQueryVariables>(GetHackathonsDocument, options);
}
export type GetHackathonsQueryHookResult = ReturnType<typeof useGetHackathonsQuery>;
export type GetHackathonsLazyQueryHookResult = ReturnType<typeof useGetHackathonsLazyQuery>;
export type GetHackathonsQueryResult = Apollo.QueryResult<GetHackathonsQuery, GetHackathonsQueryVariables>;
@@ -1638,13 +1640,13 @@ export const TrendingPostsDocument = gql`
* });
*/
export function useTrendingPostsQuery(baseOptions?: Apollo.QueryHookOptions<TrendingPostsQuery, TrendingPostsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<TrendingPostsQuery, TrendingPostsQueryVariables>(TrendingPostsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<TrendingPostsQuery, TrendingPostsQueryVariables>(TrendingPostsDocument, options);
}
export function useTrendingPostsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<TrendingPostsQuery, TrendingPostsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<TrendingPostsQuery, TrendingPostsQueryVariables>(TrendingPostsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<TrendingPostsQuery, TrendingPostsQueryVariables>(TrendingPostsDocument, options);
}
export type TrendingPostsQueryHookResult = ReturnType<typeof useTrendingPostsQuery>;
export type TrendingPostsLazyQueryHookResult = ReturnType<typeof useTrendingPostsLazyQuery>;
export type TrendingPostsQueryResult = Apollo.QueryResult<TrendingPostsQuery, TrendingPostsQueryVariables>;
@@ -1687,13 +1689,13 @@ export const GetMyDraftsDocument = gql`
* });
*/
export function useGetMyDraftsQuery(baseOptions: Apollo.QueryHookOptions<GetMyDraftsQuery, GetMyDraftsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetMyDraftsQuery, GetMyDraftsQueryVariables>(GetMyDraftsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetMyDraftsQuery, GetMyDraftsQueryVariables>(GetMyDraftsDocument, options);
}
export function useGetMyDraftsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetMyDraftsQuery, GetMyDraftsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetMyDraftsQuery, GetMyDraftsQueryVariables>(GetMyDraftsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetMyDraftsQuery, GetMyDraftsQueryVariables>(GetMyDraftsDocument, options);
}
export type GetMyDraftsQueryHookResult = ReturnType<typeof useGetMyDraftsQuery>;
export type GetMyDraftsLazyQueryHookResult = ReturnType<typeof useGetMyDraftsLazyQuery>;
export type GetMyDraftsQueryResult = Apollo.QueryResult<GetMyDraftsQuery, GetMyDraftsQueryVariables>;
@@ -1735,9 +1737,9 @@ export type CreateStoryMutationFn = Apollo.MutationFunction<CreateStoryMutation,
* });
*/
export function useCreateStoryMutation(baseOptions?: Apollo.MutationHookOptions<CreateStoryMutation, CreateStoryMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<CreateStoryMutation, CreateStoryMutationVariables>(CreateStoryDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<CreateStoryMutation, CreateStoryMutationVariables>(CreateStoryDocument, options);
}
export type CreateStoryMutationHookResult = ReturnType<typeof useCreateStoryMutation>;
export type CreateStoryMutationResult = Apollo.MutationResult<CreateStoryMutation>;
export type CreateStoryMutationOptions = Apollo.BaseMutationOptions<CreateStoryMutation, CreateStoryMutationVariables>;
@@ -1768,9 +1770,9 @@ export type DeleteStoryMutationFn = Apollo.MutationFunction<DeleteStoryMutation,
* });
*/
export function useDeleteStoryMutation(baseOptions?: Apollo.MutationHookOptions<DeleteStoryMutation, DeleteStoryMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<DeleteStoryMutation, DeleteStoryMutationVariables>(DeleteStoryDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<DeleteStoryMutation, DeleteStoryMutationVariables>(DeleteStoryDocument, options);
}
export type DeleteStoryMutationHookResult = ReturnType<typeof useDeleteStoryMutation>;
export type DeleteStoryMutationResult = Apollo.MutationResult<DeleteStoryMutation>;
export type DeleteStoryMutationOptions = Apollo.BaseMutationOptions<DeleteStoryMutation, DeleteStoryMutationVariables>;
@@ -1800,13 +1802,13 @@ export const PopularTagsDocument = gql`
* });
*/
export function usePopularTagsQuery(baseOptions?: Apollo.QueryHookOptions<PopularTagsQuery, PopularTagsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<PopularTagsQuery, PopularTagsQueryVariables>(PopularTagsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<PopularTagsQuery, PopularTagsQueryVariables>(PopularTagsDocument, options);
}
export function usePopularTagsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PopularTagsQuery, PopularTagsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<PopularTagsQuery, PopularTagsQueryVariables>(PopularTagsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<PopularTagsQuery, PopularTagsQueryVariables>(PopularTagsDocument, options);
}
export type PopularTagsQueryHookResult = ReturnType<typeof usePopularTagsQuery>;
export type PopularTagsLazyQueryHookResult = ReturnType<typeof usePopularTagsLazyQuery>;
export type PopularTagsQueryResult = Apollo.QueryResult<PopularTagsQuery, PopularTagsQueryVariables>;
@@ -1897,13 +1899,13 @@ export const FeedDocument = gql`
* });
*/
export function useFeedQuery(baseOptions?: Apollo.QueryHookOptions<FeedQuery, FeedQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
export function useFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FeedQuery, FeedQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<FeedQuery, FeedQueryVariables>(FeedDocument, options);
}
export type FeedQueryHookResult = ReturnType<typeof useFeedQuery>;
export type FeedLazyQueryHookResult = ReturnType<typeof useFeedLazyQuery>;
export type FeedQueryResult = Apollo.QueryResult<FeedQuery, FeedQueryVariables>;
@@ -2002,13 +2004,13 @@ export const PostDetailsDocument = gql`
* });
*/
export function usePostDetailsQuery(baseOptions: Apollo.QueryHookOptions<PostDetailsQuery, PostDetailsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<PostDetailsQuery, PostDetailsQueryVariables>(PostDetailsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<PostDetailsQuery, PostDetailsQueryVariables>(PostDetailsDocument, options);
}
export function usePostDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PostDetailsQuery, PostDetailsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<PostDetailsQuery, PostDetailsQueryVariables>(PostDetailsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<PostDetailsQuery, PostDetailsQueryVariables>(PostDetailsDocument, options);
}
export type PostDetailsQueryHookResult = ReturnType<typeof usePostDetailsQuery>;
export type PostDetailsLazyQueryHookResult = ReturnType<typeof usePostDetailsLazyQuery>;
export type PostDetailsQueryResult = Apollo.QueryResult<PostDetailsQuery, PostDetailsQueryVariables>;
@@ -2037,13 +2039,13 @@ export const MyProfileAboutDocument = gql`
* });
*/
export function useMyProfileAboutQuery(baseOptions?: Apollo.QueryHookOptions<MyProfileAboutQuery, MyProfileAboutQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<MyProfileAboutQuery, MyProfileAboutQueryVariables>(MyProfileAboutDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MyProfileAboutQuery, MyProfileAboutQueryVariables>(MyProfileAboutDocument, options);
}
export function useMyProfileAboutLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MyProfileAboutQuery, MyProfileAboutQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<MyProfileAboutQuery, MyProfileAboutQueryVariables>(MyProfileAboutDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MyProfileAboutQuery, MyProfileAboutQueryVariables>(MyProfileAboutDocument, options);
}
export type MyProfileAboutQueryHookResult = ReturnType<typeof useMyProfileAboutQuery>;
export type MyProfileAboutLazyQueryHookResult = ReturnType<typeof useMyProfileAboutLazyQuery>;
export type MyProfileAboutQueryResult = Apollo.QueryResult<MyProfileAboutQuery, MyProfileAboutQueryVariables>;
@@ -2075,9 +2077,9 @@ export type UpdateProfileAboutMutationFn = Apollo.MutationFunction<UpdateProfile
* });
*/
export function useUpdateProfileAboutMutation(baseOptions?: Apollo.MutationHookOptions<UpdateProfileAboutMutation, UpdateProfileAboutMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<UpdateProfileAboutMutation, UpdateProfileAboutMutationVariables>(UpdateProfileAboutDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateProfileAboutMutation, UpdateProfileAboutMutationVariables>(UpdateProfileAboutDocument, options);
}
export type UpdateProfileAboutMutationHookResult = ReturnType<typeof useUpdateProfileAboutMutation>;
export type UpdateProfileAboutMutationResult = Apollo.MutationResult<UpdateProfileAboutMutation>;
export type UpdateProfileAboutMutationOptions = Apollo.BaseMutationOptions<UpdateProfileAboutMutation, UpdateProfileAboutMutationVariables>;
@@ -2112,13 +2114,13 @@ export const MyProfilePreferencesDocument = gql`
* });
*/
export function useMyProfilePreferencesQuery(baseOptions?: Apollo.QueryHookOptions<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>(MyProfilePreferencesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>(MyProfilePreferencesDocument, options);
}
export function useMyProfilePreferencesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>(MyProfilePreferencesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>(MyProfilePreferencesDocument, options);
}
export type MyProfilePreferencesQueryHookResult = ReturnType<typeof useMyProfilePreferencesQuery>;
export type MyProfilePreferencesLazyQueryHookResult = ReturnType<typeof useMyProfilePreferencesLazyQuery>;
export type MyProfilePreferencesQueryResult = Apollo.QueryResult<MyProfilePreferencesQuery, MyProfilePreferencesQueryVariables>;
@@ -2155,9 +2157,9 @@ export type UpdateUserPreferencesMutationFn = Apollo.MutationFunction<UpdateUser
* });
*/
export function useUpdateUserPreferencesMutation(baseOptions?: Apollo.MutationHookOptions<UpdateUserPreferencesMutation, UpdateUserPreferencesMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<UpdateUserPreferencesMutation, UpdateUserPreferencesMutationVariables>(UpdateUserPreferencesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateUserPreferencesMutation, UpdateUserPreferencesMutationVariables>(UpdateUserPreferencesDocument, options);
}
export type UpdateUserPreferencesMutationHookResult = ReturnType<typeof useUpdateUserPreferencesMutation>;
export type UpdateUserPreferencesMutationResult = Apollo.MutationResult<UpdateUserPreferencesMutation>;
export type UpdateUserPreferencesMutationOptions = Apollo.BaseMutationOptions<UpdateUserPreferencesMutation, UpdateUserPreferencesMutationVariables>;
@@ -2195,13 +2197,13 @@ export const MyProfileRolesSkillsDocument = gql`
* });
*/
export function useMyProfileRolesSkillsQuery(baseOptions?: Apollo.QueryHookOptions<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>(MyProfileRolesSkillsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>(MyProfileRolesSkillsDocument, options);
}
export function useMyProfileRolesSkillsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>(MyProfileRolesSkillsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>(MyProfileRolesSkillsDocument, options);
}
export type MyProfileRolesSkillsQueryHookResult = ReturnType<typeof useMyProfileRolesSkillsQuery>;
export type MyProfileRolesSkillsLazyQueryHookResult = ReturnType<typeof useMyProfileRolesSkillsLazyQuery>;
export type MyProfileRolesSkillsQueryResult = Apollo.QueryResult<MyProfileRolesSkillsQuery, MyProfileRolesSkillsQueryVariables>;
@@ -2242,9 +2244,9 @@ export type UpdateUserRolesSkillsMutationFn = Apollo.MutationFunction<UpdateUser
* });
*/
export function useUpdateUserRolesSkillsMutation(baseOptions?: Apollo.MutationHookOptions<UpdateUserRolesSkillsMutation, UpdateUserRolesSkillsMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<UpdateUserRolesSkillsMutation, UpdateUserRolesSkillsMutationVariables>(UpdateUserRolesSkillsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateUserRolesSkillsMutation, UpdateUserRolesSkillsMutationVariables>(UpdateUserRolesSkillsDocument, options);
}
export type UpdateUserRolesSkillsMutationHookResult = ReturnType<typeof useUpdateUserRolesSkillsMutation>;
export type UpdateUserRolesSkillsMutationResult = Apollo.MutationResult<UpdateUserRolesSkillsMutation>;
export type UpdateUserRolesSkillsMutationOptions = Apollo.BaseMutationOptions<UpdateUserRolesSkillsMutation, UpdateUserRolesSkillsMutationVariables>;
@@ -2298,13 +2300,13 @@ ${UserRolesSkillsFragmentDoc}`;
* });
*/
export function useProfileQuery(baseOptions: Apollo.QueryHookOptions<ProfileQuery, ProfileQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<ProfileQuery, ProfileQueryVariables>(ProfileDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<ProfileQuery, ProfileQueryVariables>(ProfileDocument, options);
}
export function useProfileLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ProfileQuery, ProfileQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<ProfileQuery, ProfileQueryVariables>(ProfileDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<ProfileQuery, ProfileQueryVariables>(ProfileDocument, options);
}
export type ProfileQueryHookResult = ReturnType<typeof useProfileQuery>;
export type ProfileLazyQueryHookResult = ReturnType<typeof useProfileLazyQuery>;
export type ProfileQueryResult = Apollo.QueryResult<ProfileQuery, ProfileQueryVariables>;
@@ -2346,13 +2348,13 @@ export const CategoryPageDocument = gql`
* });
*/
export function useCategoryPageQuery(baseOptions: Apollo.QueryHookOptions<CategoryPageQuery, CategoryPageQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<CategoryPageQuery, CategoryPageQueryVariables>(CategoryPageDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<CategoryPageQuery, CategoryPageQueryVariables>(CategoryPageDocument, options);
}
export function useCategoryPageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CategoryPageQuery, CategoryPageQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<CategoryPageQuery, CategoryPageQueryVariables>(CategoryPageDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<CategoryPageQuery, CategoryPageQueryVariables>(CategoryPageDocument, options);
}
export type CategoryPageQueryHookResult = ReturnType<typeof useCategoryPageQuery>;
export type CategoryPageLazyQueryHookResult = ReturnType<typeof useCategoryPageLazyQuery>;
export type CategoryPageQueryResult = Apollo.QueryResult<CategoryPageQuery, CategoryPageQueryVariables>;
@@ -2382,13 +2384,13 @@ export const AllCategoriesDocument = gql`
* });
*/
export function useAllCategoriesQuery(baseOptions?: Apollo.QueryHookOptions<AllCategoriesQuery, AllCategoriesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<AllCategoriesQuery, AllCategoriesQueryVariables>(AllCategoriesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<AllCategoriesQuery, AllCategoriesQueryVariables>(AllCategoriesDocument, options);
}
export function useAllCategoriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AllCategoriesQuery, AllCategoriesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<AllCategoriesQuery, AllCategoriesQueryVariables>(AllCategoriesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<AllCategoriesQuery, AllCategoriesQueryVariables>(AllCategoriesDocument, options);
}
export type AllCategoriesQueryHookResult = ReturnType<typeof useAllCategoriesQuery>;
export type AllCategoriesLazyQueryHookResult = ReturnType<typeof useAllCategoriesLazyQuery>;
export type AllCategoriesQueryResult = Apollo.QueryResult<AllCategoriesQuery, AllCategoriesQueryVariables>;
@@ -2447,13 +2449,13 @@ export const ExploreProjectsDocument = gql`
* });
*/
export function useExploreProjectsQuery(baseOptions?: Apollo.QueryHookOptions<ExploreProjectsQuery, ExploreProjectsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<ExploreProjectsQuery, ExploreProjectsQueryVariables>(ExploreProjectsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<ExploreProjectsQuery, ExploreProjectsQueryVariables>(ExploreProjectsDocument, options);
}
export function useExploreProjectsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExploreProjectsQuery, ExploreProjectsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<ExploreProjectsQuery, ExploreProjectsQueryVariables>(ExploreProjectsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<ExploreProjectsQuery, ExploreProjectsQueryVariables>(ExploreProjectsDocument, options);
}
export type ExploreProjectsQueryHookResult = ReturnType<typeof useExploreProjectsQuery>;
export type ExploreProjectsLazyQueryHookResult = ReturnType<typeof useExploreProjectsLazyQuery>;
export type ExploreProjectsQueryResult = Apollo.QueryResult<ExploreProjectsQuery, ExploreProjectsQueryVariables>;
@@ -2488,13 +2490,13 @@ export const HottestProjectsDocument = gql`
* });
*/
export function useHottestProjectsQuery(baseOptions?: Apollo.QueryHookOptions<HottestProjectsQuery, HottestProjectsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<HottestProjectsQuery, HottestProjectsQueryVariables>(HottestProjectsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<HottestProjectsQuery, HottestProjectsQueryVariables>(HottestProjectsDocument, options);
}
export function useHottestProjectsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<HottestProjectsQuery, HottestProjectsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<HottestProjectsQuery, HottestProjectsQueryVariables>(HottestProjectsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<HottestProjectsQuery, HottestProjectsQueryVariables>(HottestProjectsDocument, options);
}
export type HottestProjectsQueryHookResult = ReturnType<typeof useHottestProjectsQuery>;
export type HottestProjectsLazyQueryHookResult = ReturnType<typeof useHottestProjectsLazyQuery>;
export type HottestProjectsQueryResult = Apollo.QueryResult<HottestProjectsQuery, HottestProjectsQueryVariables>;
@@ -2524,13 +2526,13 @@ export const GetAllCapabilitiesDocument = gql`
* });
*/
export function useGetAllCapabilitiesQuery(baseOptions?: Apollo.QueryHookOptions<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>(GetAllCapabilitiesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>(GetAllCapabilitiesDocument, options);
}
export function useGetAllCapabilitiesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>(GetAllCapabilitiesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>(GetAllCapabilitiesDocument, options);
}
export type GetAllCapabilitiesQueryHookResult = ReturnType<typeof useGetAllCapabilitiesQuery>;
export type GetAllCapabilitiesLazyQueryHookResult = ReturnType<typeof useGetAllCapabilitiesLazyQuery>;
export type GetAllCapabilitiesQueryResult = Apollo.QueryResult<GetAllCapabilitiesQuery, GetAllCapabilitiesQueryVariables>;
@@ -2563,9 +2565,9 @@ export type CreateProjectMutationFn = Apollo.MutationFunction<CreateProjectMutat
* });
*/
export function useCreateProjectMutation(baseOptions?: Apollo.MutationHookOptions<CreateProjectMutation, CreateProjectMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<CreateProjectMutation, CreateProjectMutationVariables>(CreateProjectDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<CreateProjectMutation, CreateProjectMutationVariables>(CreateProjectDocument, options);
}
export type CreateProjectMutationHookResult = ReturnType<typeof useCreateProjectMutation>;
export type CreateProjectMutationResult = Apollo.MutationResult<CreateProjectMutation>;
export type CreateProjectMutationOptions = Apollo.BaseMutationOptions<CreateProjectMutation, CreateProjectMutationVariables>;
@@ -2598,9 +2600,9 @@ export type UpdateProjectMutationFn = Apollo.MutationFunction<UpdateProjectMutat
* });
*/
export function useUpdateProjectMutation(baseOptions?: Apollo.MutationHookOptions<UpdateProjectMutation, UpdateProjectMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<UpdateProjectMutation, UpdateProjectMutationVariables>(UpdateProjectDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateProjectMutation, UpdateProjectMutationVariables>(UpdateProjectDocument, options);
}
export type UpdateProjectMutationHookResult = ReturnType<typeof useUpdateProjectMutation>;
export type UpdateProjectMutationResult = Apollo.MutationResult<UpdateProjectMutation>;
export type UpdateProjectMutationOptions = Apollo.BaseMutationOptions<UpdateProjectMutation, UpdateProjectMutationVariables>;
@@ -2628,13 +2630,13 @@ export const IsValidProjectHashtagDocument = gql`
* });
*/
export function useIsValidProjectHashtagQuery(baseOptions: Apollo.QueryHookOptions<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>(IsValidProjectHashtagDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>(IsValidProjectHashtagDocument, options);
}
export function useIsValidProjectHashtagLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>(IsValidProjectHashtagDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>(IsValidProjectHashtagDocument, options);
}
export type IsValidProjectHashtagQueryHookResult = ReturnType<typeof useIsValidProjectHashtagQuery>;
export type IsValidProjectHashtagLazyQueryHookResult = ReturnType<typeof useIsValidProjectHashtagLazyQuery>;
export type IsValidProjectHashtagQueryResult = Apollo.QueryResult<IsValidProjectHashtagQuery, IsValidProjectHashtagQueryVariables>;
@@ -2663,19 +2665,19 @@ export const GetTournamentsToRegisterDocument = gql`
* });
*/
export function useGetTournamentsToRegisterQuery(baseOptions?: Apollo.QueryHookOptions<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>(GetTournamentsToRegisterDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>(GetTournamentsToRegisterDocument, options);
}
export function useGetTournamentsToRegisterLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>(GetTournamentsToRegisterDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>(GetTournamentsToRegisterDocument, options);
}
export type GetTournamentsToRegisterQueryHookResult = ReturnType<typeof useGetTournamentsToRegisterQuery>;
export type GetTournamentsToRegisterLazyQueryHookResult = ReturnType<typeof useGetTournamentsToRegisterLazyQuery>;
export type GetTournamentsToRegisterQueryResult = Apollo.QueryResult<GetTournamentsToRegisterQuery, GetTournamentsToRegisterQueryVariables>;
export const ProjectDetailsDocument = gql`
query ProjectDetails($projectId: Int!) {
getProject(id: $projectId) {
query ProjectDetails($projectId: Int, $projectTag: String) {
getProject(id: $projectId, tag: $projectTag) {
id
title
tagline
@@ -2746,17 +2748,18 @@ export const ProjectDetailsDocument = gql`
* const { data, loading, error } = useProjectDetailsQuery({
* variables: {
* projectId: // value for 'projectId'
* projectTag: // value for 'projectTag'
* },
* });
*/
export function useProjectDetailsQuery(baseOptions: Apollo.QueryHookOptions<ProjectDetailsQuery, ProjectDetailsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<ProjectDetailsQuery, ProjectDetailsQueryVariables>(ProjectDetailsDocument, options);
}
export function useProjectDetailsQuery(baseOptions?: Apollo.QueryHookOptions<ProjectDetailsQuery, ProjectDetailsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<ProjectDetailsQuery, ProjectDetailsQueryVariables>(ProjectDetailsDocument, options);
}
export function useProjectDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ProjectDetailsQuery, ProjectDetailsQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<ProjectDetailsQuery, ProjectDetailsQueryVariables>(ProjectDetailsDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<ProjectDetailsQuery, ProjectDetailsQueryVariables>(ProjectDetailsDocument, options);
}
export type ProjectDetailsQueryHookResult = ReturnType<typeof useProjectDetailsQuery>;
export type ProjectDetailsLazyQueryHookResult = ReturnType<typeof useProjectDetailsLazyQuery>;
export type ProjectDetailsQueryResult = Apollo.QueryResult<ProjectDetailsQuery, ProjectDetailsQueryVariables>;
@@ -2786,13 +2789,13 @@ export const GetAllRolesDocument = gql`
* });
*/
export function useGetAllRolesQuery(baseOptions?: Apollo.QueryHookOptions<GetAllRolesQuery, GetAllRolesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetAllRolesQuery, GetAllRolesQueryVariables>(GetAllRolesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetAllRolesQuery, GetAllRolesQueryVariables>(GetAllRolesDocument, options);
}
export function useGetAllRolesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAllRolesQuery, GetAllRolesQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetAllRolesQuery, GetAllRolesQueryVariables>(GetAllRolesDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetAllRolesQuery, GetAllRolesQueryVariables>(GetAllRolesDocument, options);
}
export type GetAllRolesQueryHookResult = ReturnType<typeof useGetAllRolesQuery>;
export type GetAllRolesLazyQueryHookResult = ReturnType<typeof useGetAllRolesLazyQuery>;
export type GetAllRolesQueryResult = Apollo.QueryResult<GetAllRolesQuery, GetAllRolesQueryVariables>;
@@ -2856,13 +2859,13 @@ export const GetMakersInTournamentDocument = gql`
* });
*/
export function useGetMakersInTournamentQuery(baseOptions: Apollo.QueryHookOptions<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>(GetMakersInTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>(GetMakersInTournamentDocument, options);
}
export function useGetMakersInTournamentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>(GetMakersInTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>(GetMakersInTournamentDocument, options);
}
export type GetMakersInTournamentQueryHookResult = ReturnType<typeof useGetMakersInTournamentQuery>;
export type GetMakersInTournamentLazyQueryHookResult = ReturnType<typeof useGetMakersInTournamentLazyQuery>;
export type GetMakersInTournamentQueryResult = Apollo.QueryResult<GetMakersInTournamentQuery, GetMakersInTournamentQueryVariables>;
@@ -2919,13 +2922,13 @@ export const GetProjectsInTournamentDocument = gql`
* });
*/
export function useGetProjectsInTournamentQuery(baseOptions: Apollo.QueryHookOptions<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>(GetProjectsInTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>(GetProjectsInTournamentDocument, options);
}
export function useGetProjectsInTournamentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>(GetProjectsInTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>(GetProjectsInTournamentDocument, options);
}
export type GetProjectsInTournamentQueryHookResult = ReturnType<typeof useGetProjectsInTournamentQuery>;
export type GetProjectsInTournamentLazyQueryHookResult = ReturnType<typeof useGetProjectsInTournamentLazyQuery>;
export type GetProjectsInTournamentQueryResult = Apollo.QueryResult<GetProjectsInTournamentQuery, GetProjectsInTournamentQueryVariables>;
@@ -2959,9 +2962,9 @@ export type UpdateTournamentRegistrationMutationFn = Apollo.MutationFunction<Upd
* });
*/
export function useUpdateTournamentRegistrationMutation(baseOptions?: Apollo.MutationHookOptions<UpdateTournamentRegistrationMutation, UpdateTournamentRegistrationMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<UpdateTournamentRegistrationMutation, UpdateTournamentRegistrationMutationVariables>(UpdateTournamentRegistrationDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateTournamentRegistrationMutation, UpdateTournamentRegistrationMutationVariables>(UpdateTournamentRegistrationDocument, options);
}
export type UpdateTournamentRegistrationMutationHookResult = ReturnType<typeof useUpdateTournamentRegistrationMutation>;
export type UpdateTournamentRegistrationMutationResult = Apollo.MutationResult<UpdateTournamentRegistrationMutation>;
export type UpdateTournamentRegistrationMutationOptions = Apollo.BaseMutationOptions<UpdateTournamentRegistrationMutation, UpdateTournamentRegistrationMutationVariables>;
@@ -2994,9 +2997,9 @@ export type RegisterInTournamentMutationFn = Apollo.MutationFunction<RegisterInT
* });
*/
export function useRegisterInTournamentMutation(baseOptions?: Apollo.MutationHookOptions<RegisterInTournamentMutation, RegisterInTournamentMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<RegisterInTournamentMutation, RegisterInTournamentMutationVariables>(RegisterInTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<RegisterInTournamentMutation, RegisterInTournamentMutationVariables>(RegisterInTournamentDocument, options);
}
export type RegisterInTournamentMutationHookResult = ReturnType<typeof useRegisterInTournamentMutation>;
export type RegisterInTournamentMutationResult = Apollo.MutationResult<RegisterInTournamentMutation>;
export type RegisterInTournamentMutationOptions = Apollo.BaseMutationOptions<RegisterInTournamentMutation, RegisterInTournamentMutationVariables>;
@@ -3036,13 +3039,13 @@ export const MeTournamentDocument = gql`
* });
*/
export function useMeTournamentQuery(baseOptions: Apollo.QueryHookOptions<MeTournamentQuery, MeTournamentQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<MeTournamentQuery, MeTournamentQueryVariables>(MeTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MeTournamentQuery, MeTournamentQueryVariables>(MeTournamentDocument, options);
}
export function useMeTournamentLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MeTournamentQuery, MeTournamentQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<MeTournamentQuery, MeTournamentQueryVariables>(MeTournamentDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MeTournamentQuery, MeTournamentQueryVariables>(MeTournamentDocument, options);
}
export type MeTournamentQueryHookResult = ReturnType<typeof useMeTournamentQuery>;
export type MeTournamentLazyQueryHookResult = ReturnType<typeof useMeTournamentLazyQuery>;
export type MeTournamentQueryResult = Apollo.QueryResult<MeTournamentQuery, MeTournamentQueryVariables>;
@@ -3130,13 +3133,13 @@ export const GetTournamentByIdDocument = gql`
* });
*/
export function useGetTournamentByIdQuery(baseOptions: Apollo.QueryHookOptions<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useQuery<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>(GetTournamentByIdDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>(GetTournamentByIdDocument, options);
}
export function useGetTournamentByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useLazyQuery<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>(GetTournamentByIdDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>(GetTournamentByIdDocument, options);
}
export type GetTournamentByIdQueryHookResult = ReturnType<typeof useGetTournamentByIdQuery>;
export type GetTournamentByIdLazyQueryHookResult = ReturnType<typeof useGetTournamentByIdLazyQuery>;
export type GetTournamentByIdQueryResult = Apollo.QueryResult<GetTournamentByIdQuery, GetTournamentByIdQueryVariables>;
@@ -3175,9 +3178,9 @@ export type VoteMutationFn = Apollo.MutationFunction<VoteMutation, VoteMutationV
* });
*/
export function useVoteMutation(baseOptions?: Apollo.MutationHookOptions<VoteMutation, VoteMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument, options);
}
export type VoteMutationHookResult = ReturnType<typeof useVoteMutation>;
export type VoteMutationResult = Apollo.MutationResult<VoteMutation>;
export type VoteMutationOptions = Apollo.BaseMutationOptions<VoteMutation, VoteMutationVariables>;
@@ -3215,9 +3218,9 @@ export type ConfirmVoteMutationFn = Apollo.MutationFunction<ConfirmVoteMutation,
* });
*/
export function useConfirmVoteMutation(baseOptions?: Apollo.MutationHookOptions<ConfirmVoteMutation, ConfirmVoteMutationVariables>) {
const options = { ...defaultOptions, ...baseOptions }
return Apollo.useMutation<ConfirmVoteMutation, ConfirmVoteMutationVariables>(ConfirmVoteDocument, options);
}
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<ConfirmVoteMutation, ConfirmVoteMutationVariables>(ConfirmVoteDocument, options);
}
export type ConfirmVoteMutationHookResult = ReturnType<typeof useConfirmVoteMutation>;
export type ConfirmVoteMutationResult = Apollo.MutationResult<ConfirmVoteMutation>;
export type ConfirmVoteMutationOptions = Apollo.BaseMutationOptions<ConfirmVoteMutation, ConfirmVoteMutationVariables>;

View File

@@ -104,11 +104,11 @@ export const handlers = [
graphql.query<ProjectDetailsQuery, ProjectDetailsQueryVariables>('ProjectDetails', async (req, res, ctx) => {
await delay()
const { projectId } = req.variables
const { projectId, projectTag } = req.variables
return res(
ctx.data({
getProject: getProject(projectId) as any
getProject: getProject(projectId, projectTag) as any
})
)
}),

View File

@@ -4,6 +4,7 @@ import { Chance } from "chance";
import { tags } from "./data/tags";
import { hackathons } from "./data/hackathon";
import { shuffle } from "src/utils/helperFunctions";
import { Nullable } from "remirror";
const chance = new Chance()
@@ -32,8 +33,10 @@ export function newProjects() {
return shuffle(MOCK_DATA.projects).slice(0, 10);
}
export function getProject(projectId: number) {
return MOCK_DATA.projects.find(p => p.id === projectId)!
export function getProject(id: Nullable<number>, tag: Nullable<string>) {
if (id)
return MOCK_DATA.projects.find(p => p.id === id)
return MOCK_DATA.projects.find(p => p.hashtag === tag)
}
export function searchProjects(search: string) {