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"]>;
|
description?: Maybe<Scalars["String"]["output"]>;
|
||||||
endDate: Scalars["DateTime"]["output"];
|
endDate: Scalars["DateTime"]["output"];
|
||||||
id: Scalars["ID"]["output"];
|
id: Scalars["ID"]["output"];
|
||||||
|
invitations: Array<ChallengeInvitation>;
|
||||||
isPublic: Scalars["Boolean"]["output"];
|
isPublic: Scalars["Boolean"]["output"];
|
||||||
maxAttempts?: Maybe<Scalars["Int"]["output"]>;
|
maxAttempts?: Maybe<Scalars["Int"]["output"]>;
|
||||||
minimumShots: Scalars["Int"]["output"];
|
minimumShots: Scalars["Int"]["output"];
|
||||||
name: Scalars["String"]["output"];
|
name: Scalars["String"]["output"];
|
||||||
|
participantCount: Scalars["Int"]["output"];
|
||||||
requiredPocketSize?: Maybe<Scalars["Float"]["output"]>;
|
requiredPocketSize?: Maybe<Scalars["Float"]["output"]>;
|
||||||
requiredTableSize?: Maybe<Scalars["Float"]["output"]>;
|
requiredTableSize?: Maybe<Scalars["Float"]["output"]>;
|
||||||
ruleSet: RuleSet;
|
ruleSet: RuleSet;
|
||||||
@@ -177,6 +179,7 @@ export type ChallengeInvitation = {
|
|||||||
challenge: Challenge;
|
challenge: Challenge;
|
||||||
createdAt: Scalars["DateTime"]["output"];
|
createdAt: Scalars["DateTime"]["output"];
|
||||||
id: Scalars["ID"]["output"];
|
id: Scalars["ID"]["output"];
|
||||||
|
invitee: UserGql;
|
||||||
inviter: UserGql;
|
inviter: UserGql;
|
||||||
status: Scalars["String"]["output"];
|
status: Scalars["String"]["output"];
|
||||||
};
|
};
|
||||||
@@ -3568,6 +3571,7 @@ export type GetChallengeQuery = {
|
|||||||
requiredPocketSize?: number | null;
|
requiredPocketSize?: number | null;
|
||||||
isPublic: boolean;
|
isPublic: boolean;
|
||||||
maxAttempts?: number | null;
|
maxAttempts?: number | null;
|
||||||
|
participantCount: number;
|
||||||
ruleSet: {
|
ruleSet: {
|
||||||
__typename?: "RuleSet";
|
__typename?: "RuleSet";
|
||||||
id: string;
|
id: string;
|
||||||
@@ -3580,6 +3584,24 @@ export type GetChallengeQuery = {
|
|||||||
username: string;
|
username: string;
|
||||||
profileImageUri?: string | null;
|
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;
|
} | 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<{
|
export type CreateRuleSetMutationVariables = Exact<{
|
||||||
name: Scalars["String"]["input"];
|
name: Scalars["String"]["input"];
|
||||||
description?: InputMaybe<Scalars["String"]["input"]>;
|
description?: InputMaybe<Scalars["String"]["input"]>;
|
||||||
@@ -4106,6 +4148,7 @@ export type GetVideoFeedQuery = {
|
|||||||
__typename?: "Query";
|
__typename?: "Query";
|
||||||
getFeedVideos: {
|
getFeedVideos: {
|
||||||
__typename?: "VideoHistoryGQL";
|
__typename?: "VideoHistoryGQL";
|
||||||
|
hasFollowing: boolean;
|
||||||
videos: Array<{
|
videos: Array<{
|
||||||
__typename?: "VideoGQL";
|
__typename?: "VideoGQL";
|
||||||
id: number;
|
id: number;
|
||||||
@@ -6829,6 +6872,7 @@ export const GetChallengeDocument = gql`
|
|||||||
requiredPocketSize
|
requiredPocketSize
|
||||||
isPublic
|
isPublic
|
||||||
maxAttempts
|
maxAttempts
|
||||||
|
participantCount
|
||||||
ruleSet {
|
ruleSet {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -6839,6 +6883,21 @@ export const GetChallengeDocument = gql`
|
|||||||
username
|
username
|
||||||
profileImageUri
|
profileImageUri
|
||||||
}
|
}
|
||||||
|
invitations {
|
||||||
|
id
|
||||||
|
status
|
||||||
|
createdAt
|
||||||
|
invitee {
|
||||||
|
id
|
||||||
|
username
|
||||||
|
profileImageUri
|
||||||
|
}
|
||||||
|
inviter {
|
||||||
|
id
|
||||||
|
username
|
||||||
|
profileImageUri
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -7160,6 +7219,91 @@ export type GetMyChallengeInvitationsQueryResult = Apollo.QueryResult<
|
|||||||
GetMyChallengeInvitationsQuery,
|
GetMyChallengeInvitationsQuery,
|
||||||
GetMyChallengeInvitationsQueryVariables
|
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`
|
export const CreateRuleSetDocument = gql`
|
||||||
mutation CreateRuleSet($name: String!, $description: String) {
|
mutation CreateRuleSet($name: String!, $description: String) {
|
||||||
createRuleSet(name: $name, description: $description) {
|
createRuleSet(name: $name, description: $description) {
|
||||||
@@ -8085,6 +8229,7 @@ export const GetVideoFeedDocument = gql`
|
|||||||
hasNextPage
|
hasNextPage
|
||||||
endCursor
|
endCursor
|
||||||
}
|
}
|
||||||
|
hasFollowing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
${VideoCardFieldsFragmentDoc}
|
${VideoCardFieldsFragmentDoc}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ query GetChallenge($id: ID!) {
|
|||||||
requiredPocketSize
|
requiredPocketSize
|
||||||
isPublic
|
isPublic
|
||||||
maxAttempts
|
maxAttempts
|
||||||
|
participantCount
|
||||||
ruleSet {
|
ruleSet {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -49,6 +50,21 @@ query GetChallenge($id: ID!) {
|
|||||||
username
|
username
|
||||||
profileImageUri
|
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) {
|
mutation CreateRuleSet($name: String!, $description: String) {
|
||||||
createRuleSet(name: $name, description: $description) {
|
createRuleSet(name: $name, description: $description) {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -116,5 +116,6 @@ query GetVideoFeed(
|
|||||||
hasNextPage
|
hasNextPage
|
||||||
endCursor
|
endCursor
|
||||||
}
|
}
|
||||||
|
hasFollowing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,6 +319,8 @@ type Challenge {
|
|||||||
updatedAt: DateTime!
|
updatedAt: DateTime!
|
||||||
ruleSet: RuleSet!
|
ruleSet: RuleSet!
|
||||||
createdBy: UserGQL!
|
createdBy: UserGQL!
|
||||||
|
invitations: [ChallengeInvitation!]!
|
||||||
|
participantCount: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
type RuleSet {
|
type RuleSet {
|
||||||
@@ -652,6 +654,7 @@ type ChallengeInvitation {
|
|||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
challenge: Challenge!
|
challenge: Challenge!
|
||||||
inviter: UserGQL!
|
inviter: UserGQL!
|
||||||
|
invitee: UserGQL!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeployedConfigGQL {
|
type DeployedConfigGQL {
|
||||||
|
|||||||
Reference in New Issue
Block a user