-
Notifications
You must be signed in to change notification settings - Fork 113
feat(gear): implement GraphQL API endpoints for user gear #3492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add userGear query with pagination support - Add autocompleteGear query for gear suggestions - Add addUserGear mutation with find-or-create dataset pattern - Add deleteUserGear mutation for removing gear items - Add reorderUserGear mutation for position management - Add Zod validation schemas for inputs - Add findOrCreateDatasetGear helper with name normalization - Add graphorm mappings for UserGear and DatasetGear entities - Add comprehensive test coverage Implements ENG-391
|
Chris seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
🍹 The Update (preview) for dailydotdev/api/prod (at a72f93f) was successful. Resource Changes Name Type Operation
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generic-referral-reminder-cron kubernetes:batch/v1:CronJob update
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
- vpc-native-api-clickhouse-migration-4b83ad1c kubernetes:batch/v1:Job delete
- vpc-native-api-db-migration-4b83ad1c kubernetes:batch/v1:Job delete
+ vpc-native-api-clickhouse-migration-2b4672a0 kubernetes:batch/v1:Job create
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-analytics-history-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-user-profile-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
~ vpc-native-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tag-recommendations-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-db-migration-2b4672a0 kubernetes:batch/v1:Job create
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-ws-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-tags-str-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-tag-view-cron kubernetes:batch/v1:CronJob update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-history-day-clickhouse-cron kubernetes:batch/v1:CronJob update
|
rebelchris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude can you address the following:
- Missing migration for database
- Please don't prefix it with user so instead of userGear it should just be gear (please apply this change to file names and functions as well)
- See my other comments as feedback, and apply those if you agree
src/common/datasetGear.ts
Outdated
| .replace(/\./g, 'dot') | ||
| .replace(/\+/g, 'plus') | ||
| .replace(/#/g, 'sharp') | ||
| .replace(/&/g, 'and') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not needed for gear
src/schema/userGear.ts
Outdated
| """ | ||
| Autocomplete gear from dataset | ||
| """ | ||
| autocompleteGear(query: String!): [DatasetGear!]! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autocomplete should live in autocomplete schema and follow best practices from there
|
Claude finished @rebelchris's task in 5m 19s —— View job Review feedback addressed ✓Completed Tasks
Changes Made1. Database Migration
2. Renamed Files and Functions
3. Moved Autocomplete
4. Simplified datasetGear.ts
Next Steps
--- | View commit |
…tes schema - Rename all files from userGear to gear (schema, tests, common) - Update GraphQL types: UserGear -> Gear, UserGearConnection -> GearConnection - Update all queries and mutations to use gear naming - Move autocompleteGear from gear schema to autocompletes schema - Simplify datasetGear normalization (remove & to and replacement) - Update graphorm mapping from UserGear to Gear - Update all imports and references across the codebase Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
Summary
Implements ENG-391 - GraphQL queries and mutations for the Gear feature in the Profile Customization project.
Changes
New Files
src/common/schema/userGear.ts- Zod validation schemassrc/common/datasetGear.ts- findOrCreateDatasetGear helper with name normalizationsrc/schema/userGear.ts- GraphQL typeDefs and resolvers__tests__/userGear.ts- Comprehensive test coverageModified Files
src/graphorm/index.ts- Added UserGear and DatasetGear mappingssrc/graphql.ts- Imported and registered userGear schemaAPI
Queries
Mutations
Testing
Checklist
pnpm test -- --testPathPattern=userGearpnpm run buildCloses ENG-391