Skip to content

Commit

Permalink
Optimize the main vcWizard account call.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbykolev committed Jan 14, 2025
1 parent 57c5a42 commit d393ba1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 137 deletions.
31 changes: 2 additions & 29 deletions src/core/apollo/generated/apollo-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3748,27 +3748,6 @@ export const SpaceProfileCommunityDetailsFragmentDoc = gql`
}
}
`;
export const VcSelectableSpaceFragmentDoc = gql`
fragment VCSelectableSpace on Space {
id
type
profile {
id
displayName
url
}
community {
id
roleSet {
id
authorization {
id
myPrivileges
}
}
}
}
`;
export const RecentSpaceProfileFragmentDoc = gql`
fragment RecentSpaceProfile on Profile {
id
Expand Down Expand Up @@ -24388,19 +24367,13 @@ export const NewVirtualContributorMySpacesDocument = gql`
id
myPrivileges
}
...VCSelectableSpace
subspaces {
...VCSelectableSpace
subspaces {
...VCSelectableSpace
}
}
...spaceProfileCommunityDetails
}
}
}
}
}
${VcSelectableSpaceFragmentDoc}
${SpaceProfileCommunityDetailsFragmentDoc}
`;

/**
Expand Down
77 changes: 1 addition & 76 deletions src/core/apollo/generated/graphql-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31562,7 +31562,6 @@ export type NewVirtualContributorMySpacesQuery = {
spaces: Array<{
__typename?: 'Space';
id: string;
type: SpaceType;
license: {
__typename?: 'License';
id: string;
Expand All @@ -31575,64 +31574,8 @@ export type NewVirtualContributorMySpacesQuery = {
myPrivileges?: Array<AuthorizationPrivilege> | undefined;
}
| undefined;
subspaces: Array<{
__typename?: 'Space';
id: string;
type: SpaceType;
subspaces: Array<{
__typename?: 'Space';
id: string;
type: SpaceType;
profile: { __typename?: 'Profile'; id: string; displayName: string; url: string };
community: {
__typename?: 'Community';
id: string;
roleSet: {
__typename?: 'RoleSet';
id: string;
authorization?:
| {
__typename?: 'Authorization';
id: string;
myPrivileges?: Array<AuthorizationPrivilege> | undefined;
}
| undefined;
};
};
}>;
profile: { __typename?: 'Profile'; id: string; displayName: string; url: string };
community: {
__typename?: 'Community';
id: string;
roleSet: {
__typename?: 'RoleSet';
id: string;
authorization?:
| {
__typename?: 'Authorization';
id: string;
myPrivileges?: Array<AuthorizationPrivilege> | undefined;
}
| undefined;
};
};
}>;
profile: { __typename?: 'Profile'; id: string; displayName: string; url: string };
community: {
__typename?: 'Community';
id: string;
roleSet: {
__typename?: 'RoleSet';
id: string;
authorization?:
| {
__typename?: 'Authorization';
id: string;
myPrivileges?: Array<AuthorizationPrivilege> | undefined;
}
| undefined;
};
};
community: { __typename?: 'Community'; id: string; roleSet: { __typename?: 'RoleSet'; id: string } };
}>;
}
| undefined;
Expand Down Expand Up @@ -31683,24 +31626,6 @@ export type SpaceProfileCommunityDetailsFragment = {
community: { __typename?: 'Community'; id: string; roleSet: { __typename?: 'RoleSet'; id: string } };
};

export type VcSelectableSpaceFragment = {
__typename?: 'Space';
id: string;
type: SpaceType;
profile: { __typename?: 'Profile'; id: string; displayName: string; url: string };
community: {
__typename?: 'Community';
id: string;
roleSet: {
__typename?: 'RoleSet';
id: string;
authorization?:
| { __typename?: 'Authorization'; id: string; myPrivileges?: Array<AuthorizationPrivilege> | undefined }
| undefined;
};
};
};

export type RecentSpacesQueryVariables = Exact<{
limit?: InputMaybe<Scalars['Float']>;
}>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ query NewVirtualContributorMySpaces {
id
myPrivileges
}
...VCSelectableSpace
subspaces {
...VCSelectableSpace
subspaces {
...VCSelectableSpace
}
}
...spaceProfileCommunityDetails
}
}
}
Expand Down Expand Up @@ -62,23 +56,3 @@ fragment spaceProfileCommunityDetails on Space {
}
}
}

fragment VCSelectableSpace on Space {
id
type
profile {
id
displayName
url
}
community {
id
roleSet {
id
authorization {
id
myPrivileges
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export interface UserAccountProps {
id: string;
roleSet: {
id: string;
authorization?: {
id: string;
myPrivileges?: AuthorizationPrivilege[] | undefined;
};
};
};
profile: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const useNewVirtualContributorWizard = (): useNewVirtualContributorWizardProvide
};

const { data, loading } = useNewVirtualContributorMySpacesQuery({
skip: !dialogOpen,
skip: !dialogOpen || Boolean(targetAccount),
fetchPolicy: 'cache-and-network',
});

Expand Down

0 comments on commit d393ba1

Please sign in to comment.