keiji2
keiji215mo ago

Optional field not reflecting in Generated Schema if no value present yet

Hello everyone, I'm encountering an issue with my Convex project where a gender field added to my playerDescriptions table is not appearing in the generated schema on the Convex Dashboard, despite being present in my local schema.ts file. Here's what I've done so far: 1. Added gender: v.optional(v.string()) to playerDescriptions in playerDescription.ts. 2. Included playerDescriptions in my schema.ts. 3. Ran npx convex dev to sync changes. Despite these steps, the gender field is not showing up in the generated schema, although it appears correctly in the local schema definition. I've checked for syntax errors and tried restarting the development server, but the issue persists. Has anyone else experienced this or have any suggestions on what might be going wrong? Any advice would be greatly appreciated! Thank you!
No description
No description
4 Replies
jamwt
jamwt15mo ago
Hey there. Any chance it’s dev vs prod deployment in the dashboard? Have you saved any values for this field yet in your table?
keiji2
keiji2OP15mo ago
Thank you for reply! I have added the gender field to my schema, but I have not yet saved any values for this field in my table. Could this be causing the field not to appear when I try to add new documents? What would be the next steps to ensure that the gender field is recognized and available for data entry in the dashboard? Any guidance would be greatly appreciated!
No description
keiji2
keiji2OP15mo ago
The issue was resolved by manually entering a value for the "gender" field thank you
No description
jamwt
jamwt15mo ago
Makes sense. Generated schema is derived from stored values. So the field doesn’t appear there Im until you have at least one field value in a document

Did you find this page helpful?