Compare commits

...

3 Commits

Author SHA1 Message Date
a883bc3e2f getUser by user id query
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2024-12-19 10:28:41 -08:00
b50ea5b573 Merge pull request 'Sync Apollo version w/ mobile to prevent ts errors' (#150) from loewy/sync-apollo-version-w-mobile into master
Reviewed-on: #150
Reviewed-by: Ivan Malison <ivanmalison@gmail.com>
2024-12-19 11:28:04 -07:00
de17659dbb sync apollo version w/ mobile to prevent ts errors
All checks were successful
Tests / Tests (pull_request) Successful in 9s
2024-12-19 10:26:09 -08:00
4 changed files with 155 additions and 42 deletions

View File

@ -12,7 +12,7 @@
"author": "Ivan Malison <IvanMalison@gmail.com>",
"license": "MIT",
"dependencies": {
"@apollo/client": "^3.9.2",
"@apollo/client": "^3.11.10",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1",

View File

@ -3646,9 +3646,13 @@ export type EditProfileImageUriMutation = {
id: number;
firebaseUid?: string | null;
username: string;
isAdmin?: boolean | null;
profileImageUri?: string | null;
fargoRating?: number | null;
activeVideoId?: number | null;
createdAt?: any | null;
updatedAt?: any | null;
videosPrivateByDefault?: boolean | null;
};
};
@ -3671,6 +3675,27 @@ export type GetLoggedInUserQuery = {
} | null;
};
export type GetUserQueryVariables = Exact<{
userId: Scalars["Int"]["input"];
}>;
export type GetUserQuery = {
__typename?: "Query";
getUser?: {
__typename?: "UserGQL";
id: number;
firebaseUid?: string | null;
username: string;
isAdmin?: boolean | null;
profileImageUri?: string | null;
fargoRating?: number | null;
activeVideoId?: number | null;
createdAt?: any | null;
updatedAt?: any | null;
videosPrivateByDefault?: boolean | null;
} | null;
};
export type GetUserPlayTimeQueryVariables = Exact<{
userId: Scalars["Int"]["input"];
filters?: InputMaybe<VideoFilterInput>;
@ -3815,6 +3840,20 @@ export type EditUserMutation = {
};
};
export type UserFragmentFragment = {
__typename?: "UserGQL";
id: number;
firebaseUid?: string | null;
username: string;
isAdmin?: boolean | null;
profileImageUri?: string | null;
fargoRating?: number | null;
activeVideoId?: number | null;
createdAt?: any | null;
updatedAt?: any | null;
videosPrivateByDefault?: boolean | null;
};
export type GetStreamMonitoringDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
debuggingJson?: InputMaybe<Scalars["JSON"]["input"]>;
@ -4585,6 +4624,20 @@ export const ShotWithAllFeaturesFragmentDoc = gql`
}
}
`;
export const UserFragmentFragmentDoc = gql`
fragment UserFragment on UserGQL {
id
firebaseUid
username
isAdmin
profileImageUri
fargoRating
activeVideoId
createdAt
updatedAt
videosPrivateByDefault
}
`;
export const VideoStreamMetadataFragmentDoc = gql`
fragment VideoStreamMetadata on VideoGQL {
id
@ -6032,14 +6085,10 @@ export type GetProfileImageUploadLinkMutationOptions =
export const EditProfileImageUriDocument = gql`
mutation editProfileImageUri($profileImageUri: String!) {
editProfileImageUri(profileImageUri: $profileImageUri) {
id
firebaseUid
username
profileImageUri
createdAt
updatedAt
...UserFragment
}
}
${UserFragmentFragmentDoc}
`;
export type EditProfileImageUriMutationFn = Apollo.MutationFunction<
EditProfileImageUriMutation,
@ -6087,18 +6136,10 @@ export type EditProfileImageUriMutationOptions = Apollo.BaseMutationOptions<
export const GetLoggedInUserDocument = gql`
query getLoggedInUser {
getLoggedInUser {
id
firebaseUid
username
isAdmin
profileImageUri
fargoRating
activeVideoId
createdAt
updatedAt
videosPrivateByDefault
...UserFragment
}
}
${UserFragmentFragmentDoc}
`;
/**
@ -6165,6 +6206,73 @@ export type GetLoggedInUserQueryResult = Apollo.QueryResult<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>;
export const GetUserDocument = gql`
query GetUser($userId: Int!) {
getUser(userId: $userId) {
...UserFragment
}
}
${UserFragmentFragmentDoc}
`;
/**
* __useGetUserQuery__
*
* To run a query within a React component, call `useGetUserQuery` and pass it any options that fit your needs.
* When your component renders, `useGetUserQuery` 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 } = useGetUserQuery({
* variables: {
* userId: // value for 'userId'
* },
* });
*/
export function useGetUserQuery(
baseOptions: Apollo.QueryHookOptions<GetUserQuery, GetUserQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetUserQuery, GetUserQueryVariables>(
GetUserDocument,
options,
);
}
export function useGetUserLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetUserQuery,
GetUserQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetUserQuery, GetUserQueryVariables>(
GetUserDocument,
options,
);
}
export function useGetUserSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetUserQuery,
GetUserQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<GetUserQuery, GetUserQueryVariables>(
GetUserDocument,
options,
);
}
export type GetUserQueryHookResult = ReturnType<typeof useGetUserQuery>;
export type GetUserLazyQueryHookResult = ReturnType<typeof useGetUserLazyQuery>;
export type GetUserSuspenseQueryHookResult = ReturnType<
typeof useGetUserSuspenseQuery
>;
export type GetUserQueryResult = Apollo.QueryResult<
GetUserQuery,
GetUserQueryVariables
>;
export const GetUserPlayTimeDocument = gql`
query GetUserPlayTime($userId: Int!, $filters: VideoFilterInput) {
getPlayTime(userId: $userId, filters: $filters) {

View File

@ -21,27 +21,19 @@ mutation getProfileImageUploadLink($fileExt: String = ".png") {
mutation editProfileImageUri($profileImageUri: String!) {
editProfileImageUri(profileImageUri: $profileImageUri) {
id
firebaseUid
username
profileImageUri
createdAt
updatedAt
...UserFragment
}
}
query getLoggedInUser {
getLoggedInUser {
id
firebaseUid
username
isAdmin
profileImageUri
fargoRating
activeVideoId
createdAt
updatedAt
videosPrivateByDefault
...UserFragment
}
}
query GetUser($userId: Int!) {
getUser(userId: $userId) {
...UserFragment
}
}
@ -157,3 +149,16 @@ mutation editUser(
videosPrivateByDefault
}
}
fragment UserFragment on UserGQL {
id
firebaseUid
username
isAdmin
profileImageUri
fargoRating
activeVideoId
createdAt
updatedAt
videosPrivateByDefault
}

View File

@ -10,10 +10,10 @@
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"
"@apollo/client@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.9.2.tgz#96edf2c212f828bad1ef3d84234fa473c5a27ff8"
integrity sha512-Zw9WvXjqhpbgkvAvnj52vstOWwM0iedKWtn1hSq1cODQyoe1CF2uFwMYFI7l56BrAY9CzLi6MQA0AhxpgJgvxw==
"@apollo/client@^3.11.10":
version "3.12.3"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.12.3.tgz#0d252749baad8328e06883fe118dc7e73e3bbb1f"
integrity sha512-KZ5zymRdb8bMbGUb1wP2U04ff7qIGgaC1BCdCVC+IPFiXkxEhHBc5fDEQOwAUT+vUo9KbBh3g7QK/JCOswn59w==
dependencies:
"@graphql-typed-document-node/core" "^3.1.1"
"@wry/caches" "^1.0.0"
@ -23,7 +23,7 @@
hoist-non-react-statics "^3.3.2"
optimism "^0.18.0"
prop-types "^15.7.2"
rehackt "0.0.3"
rehackt "^0.1.0"
response-iterator "^0.2.6"
symbol-observable "^4.0.0"
ts-invariant "^0.10.3"
@ -2633,10 +2633,10 @@ regenerator-runtime@^0.14.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
rehackt@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/rehackt/-/rehackt-0.0.3.tgz#1ea454620d4641db8342e2db44595cf0e7ac6aa0"
integrity sha512-aBRHudKhOWwsTvCbSoinzq+Lej/7R8e8UoPvLZo5HirZIIBLGAgdG7SL9QpdcBoQ7+3QYPi3lRLknAzXBlhZ7g==
rehackt@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/rehackt/-/rehackt-0.1.0.tgz#a7c5e289c87345f70da8728a7eb878e5d03c696b"
integrity sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==
relay-runtime@12.0.0:
version "12.0.0"