feat: Add challenge invitations fields and fix feed hasFollowing query
All checks were successful
Tests / Tests (pull_request) Successful in 10s
All checks were successful
Tests / Tests (pull_request) Successful in 10s
- Add invitations query fields with invitee data to GetChallenge - Add participantCount field to GetChallenge - Add GetMyChallengeEntries query (was missing) - Add hasFollowing to GetVideoFeed response (fixes feed ordering) - Sync schema with backend challenge types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
145
src/index.tsx
145
src/index.tsx
@@ -147,10 +147,12 @@ export type Challenge = {
|
||||
description?: Maybe<Scalars["String"]["output"]>;
|
||||
endDate: Scalars["DateTime"]["output"];
|
||||
id: Scalars["ID"]["output"];
|
||||
invitations: Array<ChallengeInvitation>;
|
||||
isPublic: Scalars["Boolean"]["output"];
|
||||
maxAttempts?: Maybe<Scalars["Int"]["output"]>;
|
||||
minimumShots: Scalars["Int"]["output"];
|
||||
name: Scalars["String"]["output"];
|
||||
participantCount: Scalars["Int"]["output"];
|
||||
requiredPocketSize?: Maybe<Scalars["Float"]["output"]>;
|
||||
requiredTableSize?: Maybe<Scalars["Float"]["output"]>;
|
||||
ruleSet: RuleSet;
|
||||
@@ -177,6 +179,7 @@ export type ChallengeInvitation = {
|
||||
challenge: Challenge;
|
||||
createdAt: Scalars["DateTime"]["output"];
|
||||
id: Scalars["ID"]["output"];
|
||||
invitee: UserGql;
|
||||
inviter: UserGql;
|
||||
status: Scalars["String"]["output"];
|
||||
};
|
||||
@@ -3568,6 +3571,7 @@ export type GetChallengeQuery = {
|
||||
requiredPocketSize?: number | null;
|
||||
isPublic: boolean;
|
||||
maxAttempts?: number | null;
|
||||
participantCount: number;
|
||||
ruleSet: {
|
||||
__typename?: "RuleSet";
|
||||
id: string;
|
||||
@@ -3580,6 +3584,24 @@ export type GetChallengeQuery = {
|
||||
username: string;
|
||||
profileImageUri?: string | null;
|
||||
};
|
||||
invitations: Array<{
|
||||
__typename?: "ChallengeInvitation";
|
||||
id: string;
|
||||
status: string;
|
||||
createdAt: any;
|
||||
invitee: {
|
||||
__typename?: "UserGQL";
|
||||
id: number;
|
||||
username: string;
|
||||
profileImageUri?: string | null;
|
||||
};
|
||||
inviter: {
|
||||
__typename?: "UserGQL";
|
||||
id: number;
|
||||
username: string;
|
||||
profileImageUri?: string | null;
|
||||
};
|
||||
}>;
|
||||
} | null;
|
||||
};
|
||||
|
||||
@@ -3659,6 +3681,26 @@ export type GetMyChallengeInvitationsQuery = {
|
||||
}>;
|
||||
};
|
||||
|
||||
export type GetMyChallengeEntriesQueryVariables = Exact<{
|
||||
[key: string]: never;
|
||||
}>;
|
||||
|
||||
export type GetMyChallengeEntriesQuery = {
|
||||
__typename?: "Query";
|
||||
myChallengeEntries: Array<{
|
||||
__typename?: "ChallengeEntry";
|
||||
id: string;
|
||||
status: string;
|
||||
shotsCount?: number | null;
|
||||
makesCount?: number | null;
|
||||
makeRate?: number | null;
|
||||
qualified?: boolean | null;
|
||||
createdAt: any;
|
||||
challenge: { __typename?: "Challenge"; id: string; name: string };
|
||||
video?: { __typename?: "VideoGQL"; id: number } | null;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type CreateRuleSetMutationVariables = Exact<{
|
||||
name: Scalars["String"]["input"];
|
||||
description?: InputMaybe<Scalars["String"]["input"]>;
|
||||
@@ -4106,6 +4148,7 @@ export type GetVideoFeedQuery = {
|
||||
__typename?: "Query";
|
||||
getFeedVideos: {
|
||||
__typename?: "VideoHistoryGQL";
|
||||
hasFollowing: boolean;
|
||||
videos: Array<{
|
||||
__typename?: "VideoGQL";
|
||||
id: number;
|
||||
@@ -6829,6 +6872,7 @@ export const GetChallengeDocument = gql`
|
||||
requiredPocketSize
|
||||
isPublic
|
||||
maxAttempts
|
||||
participantCount
|
||||
ruleSet {
|
||||
id
|
||||
name
|
||||
@@ -6839,6 +6883,21 @@ export const GetChallengeDocument = gql`
|
||||
username
|
||||
profileImageUri
|
||||
}
|
||||
invitations {
|
||||
id
|
||||
status
|
||||
createdAt
|
||||
invitee {
|
||||
id
|
||||
username
|
||||
profileImageUri
|
||||
}
|
||||
inviter {
|
||||
id
|
||||
username
|
||||
profileImageUri
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -7160,6 +7219,91 @@ export type GetMyChallengeInvitationsQueryResult = Apollo.QueryResult<
|
||||
GetMyChallengeInvitationsQuery,
|
||||
GetMyChallengeInvitationsQueryVariables
|
||||
>;
|
||||
export const GetMyChallengeEntriesDocument = gql`
|
||||
query GetMyChallengeEntries {
|
||||
myChallengeEntries {
|
||||
id
|
||||
status
|
||||
shotsCount
|
||||
makesCount
|
||||
makeRate
|
||||
qualified
|
||||
createdAt
|
||||
challenge {
|
||||
id
|
||||
name
|
||||
}
|
||||
video {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useGetMyChallengeEntriesQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useGetMyChallengeEntriesQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useGetMyChallengeEntriesQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useGetMyChallengeEntriesQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useGetMyChallengeEntriesQuery(
|
||||
baseOptions?: Apollo.QueryHookOptions<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>(GetMyChallengeEntriesDocument, options);
|
||||
}
|
||||
export function useGetMyChallengeEntriesLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>(GetMyChallengeEntriesDocument, options);
|
||||
}
|
||||
export function useGetMyChallengeEntriesSuspenseQuery(
|
||||
baseOptions?: Apollo.SuspenseQueryHookOptions<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useSuspenseQuery<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>(GetMyChallengeEntriesDocument, options);
|
||||
}
|
||||
export type GetMyChallengeEntriesQueryHookResult = ReturnType<
|
||||
typeof useGetMyChallengeEntriesQuery
|
||||
>;
|
||||
export type GetMyChallengeEntriesLazyQueryHookResult = ReturnType<
|
||||
typeof useGetMyChallengeEntriesLazyQuery
|
||||
>;
|
||||
export type GetMyChallengeEntriesSuspenseQueryHookResult = ReturnType<
|
||||
typeof useGetMyChallengeEntriesSuspenseQuery
|
||||
>;
|
||||
export type GetMyChallengeEntriesQueryResult = Apollo.QueryResult<
|
||||
GetMyChallengeEntriesQuery,
|
||||
GetMyChallengeEntriesQueryVariables
|
||||
>;
|
||||
export const CreateRuleSetDocument = gql`
|
||||
mutation CreateRuleSet($name: String!, $description: String) {
|
||||
createRuleSet(name: $name, description: $description) {
|
||||
@@ -8085,6 +8229,7 @@ export const GetVideoFeedDocument = gql`
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
hasFollowing
|
||||
}
|
||||
}
|
||||
${VideoCardFieldsFragmentDoc}
|
||||
|
||||
@@ -39,6 +39,7 @@ query GetChallenge($id: ID!) {
|
||||
requiredPocketSize
|
||||
isPublic
|
||||
maxAttempts
|
||||
participantCount
|
||||
ruleSet {
|
||||
id
|
||||
name
|
||||
@@ -49,6 +50,21 @@ query GetChallenge($id: ID!) {
|
||||
username
|
||||
profileImageUri
|
||||
}
|
||||
invitations {
|
||||
id
|
||||
status
|
||||
createdAt
|
||||
invitee {
|
||||
id
|
||||
username
|
||||
profileImageUri
|
||||
}
|
||||
inviter {
|
||||
id
|
||||
username
|
||||
profileImageUri
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +122,25 @@ query GetMyChallengeInvitations {
|
||||
}
|
||||
}
|
||||
|
||||
query GetMyChallengeEntries {
|
||||
myChallengeEntries {
|
||||
id
|
||||
status
|
||||
shotsCount
|
||||
makesCount
|
||||
makeRate
|
||||
qualified
|
||||
createdAt
|
||||
challenge {
|
||||
id
|
||||
name
|
||||
}
|
||||
video {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mutation CreateRuleSet($name: String!, $description: String) {
|
||||
createRuleSet(name: $name, description: $description) {
|
||||
id
|
||||
|
||||
@@ -116,5 +116,6 @@ query GetVideoFeed(
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
hasFollowing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +319,8 @@ type Challenge {
|
||||
updatedAt: DateTime!
|
||||
ruleSet: RuleSet!
|
||||
createdBy: UserGQL!
|
||||
invitations: [ChallengeInvitation!]!
|
||||
participantCount: Int!
|
||||
}
|
||||
|
||||
type RuleSet {
|
||||
@@ -652,6 +654,7 @@ type ChallengeInvitation {
|
||||
createdAt: DateTime!
|
||||
challenge: Challenge!
|
||||
inviter: UserGQL!
|
||||
invitee: UserGQL!
|
||||
}
|
||||
|
||||
type DeployedConfigGQL {
|
||||
|
||||
Reference in New Issue
Block a user