Your Work Projects Vue - Query Followup
What / Why
Following the addition of individual GraphQL queries for each tab in the new Vue Your Work Projects. There is an opportunity to consolidate these files to further ensure the experience is consistent between all the tabs.
- Contributed tab: !164278 (merged)
- Personal tab: !165705 (merged)
- Starred tab: !166199 (merged)
- Membership tab: !166203 (merged)
- Inactive tab: !166207 (merged)
Proposal:
Similar to the solution in Geo: https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/assets/javascripts/geo_replicable/graphql/replicable_type_query_builder.js we can build GraphQL queries dynamically with JavaScript.
Example code:
export default (projectList) => {
return gql`
query {
currentUser {
id
${projectList} {
nodes {
...Project
}
}
}
}
${Project}
`;
};
Edited by Zack Cuddy