Skip to content

Commit

Permalink
fix: dev-test
Browse files Browse the repository at this point in the history
  • Loading branch information
neil585456525 committed Oct 13, 2023
1 parent ddace77 commit b226b46
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions dev-test/githunt/types.react-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ export const useCurrentUserForProfileQuery = <TData = CurrentUserForProfileQuery
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables?: CurrentUserForProfileQueryVariables,
options?: UseQueryOptions<CurrentUserForProfileQuery, TError, TData>,
) =>
useQuery<CurrentUserForProfileQuery, TError, TData>(
) => {
return useQuery<CurrentUserForProfileQuery, TError, TData>(
variables === undefined ? ['CurrentUserForProfile'] : ['CurrentUserForProfile', variables],
fetcher<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>(
dataSource.endpoint,
Expand All @@ -515,15 +515,17 @@ export const useCurrentUserForProfileQuery = <TData = CurrentUserForProfileQuery
),
options,
);
};

export const useInfiniteCurrentUserForProfileQuery = <
TData = CurrentUserForProfileQuery,
TError = unknown,
>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables?: CurrentUserForProfileQueryVariables,
options?: UseInfiniteQueryOptions<CurrentUserForProfileQuery, TError, TData>,
) =>
useInfiniteQuery<CurrentUserForProfileQuery, TError, TData>(
) => {
return useInfiniteQuery<CurrentUserForProfileQuery, TError, TData>(
variables === undefined
? ['CurrentUserForProfile.infinite']
: ['CurrentUserForProfile.infinite', variables],
Expand All @@ -536,6 +538,7 @@ export const useInfiniteCurrentUserForProfileQuery = <
)(),
options,
);
};

export const FeedDocument = `
query Feed($type: FeedType!, $offset: Int, $limit: Int) {
Expand All @@ -551,8 +554,8 @@ export const useFeedQuery = <TData = FeedQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables: FeedQueryVariables,
options?: UseQueryOptions<FeedQuery, TError, TData>,
) =>
useQuery<FeedQuery, TError, TData>(
) => {
return useQuery<FeedQuery, TError, TData>(
['Feed', variables],
fetcher<FeedQuery, FeedQueryVariables>(
dataSource.endpoint,
Expand All @@ -562,12 +565,14 @@ export const useFeedQuery = <TData = FeedQuery, TError = unknown>(
),
options,
);
};

export const useInfiniteFeedQuery = <TData = FeedQuery, TError = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
variables: FeedQueryVariables,
options?: UseInfiniteQueryOptions<FeedQuery, TError, TData>,
) =>
useInfiniteQuery<FeedQuery, TError, TData>(
) => {
return useInfiniteQuery<FeedQuery, TError, TData>(
['Feed.infinite', variables],
metaData =>
fetcher<FeedQuery, FeedQueryVariables>(
Expand All @@ -578,6 +583,7 @@ export const useInfiniteFeedQuery = <TData = FeedQuery, TError = unknown>(
)(),
options,
);
};

export const SubmitRepositoryDocument = `
mutation submitRepository($repoFullName: String!) {
Expand All @@ -594,8 +600,8 @@ export const useSubmitRepositoryMutation = <TError = unknown, TContext = unknown
SubmitRepositoryMutationVariables,
TContext
>,
) =>
useMutation<SubmitRepositoryMutation, TError, SubmitRepositoryMutationVariables, TContext>(
) => {
return useMutation<SubmitRepositoryMutation, TError, SubmitRepositoryMutationVariables, TContext>(
['submitRepository'],
(variables?: SubmitRepositoryMutationVariables) =>
fetcher<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>(
Expand All @@ -606,6 +612,8 @@ export const useSubmitRepositoryMutation = <TError = unknown, TContext = unknown
)(),
options,
);
};

export const SubmitCommentDocument = `
mutation submitComment($repoFullName: String!, $commentContent: String!) {
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
Expand All @@ -621,8 +629,8 @@ export const useSubmitCommentMutation = <TError = unknown, TContext = unknown>(
SubmitCommentMutationVariables,
TContext
>,
) =>
useMutation<SubmitCommentMutation, TError, SubmitCommentMutationVariables, TContext>(
) => {
return useMutation<SubmitCommentMutation, TError, SubmitCommentMutationVariables, TContext>(
['submitComment'],
(variables?: SubmitCommentMutationVariables) =>
fetcher<SubmitCommentMutation, SubmitCommentMutationVariables>(
Expand All @@ -633,6 +641,8 @@ export const useSubmitCommentMutation = <TError = unknown, TContext = unknown>(
)(),
options,
);
};

export const VoteDocument = `
mutation vote($repoFullName: String!, $type: VoteType!) {
vote(repoFullName: $repoFullName, type: $type) {
Expand All @@ -647,8 +657,8 @@ export const VoteDocument = `
export const useVoteMutation = <TError = unknown, TContext = unknown>(
dataSource: { endpoint: string; fetchParams?: RequestInit },
options?: UseMutationOptions<VoteMutation, TError, VoteMutationVariables, TContext>,
) =>
useMutation<VoteMutation, TError, VoteMutationVariables, TContext>(
) => {
return useMutation<VoteMutation, TError, VoteMutationVariables, TContext>(
['vote'],
(variables?: VoteMutationVariables) =>
fetcher<VoteMutation, VoteMutationVariables>(
Expand All @@ -659,3 +669,4 @@ export const useVoteMutation = <TError = unknown, TContext = unknown>(
)(),
options,
);
};

0 comments on commit b226b46

Please sign in to comment.