Estimated time: 10 minutes
By the end of this step, you'll:
Now that you understand the basics, you can customize:
I'm at step 9: Customize Your App.
Help me:
1. Add a new field to messages (like "author" or "category")
2. Update the entity creation to include the new field
3. Update the UI to display the new field
4. Update queries if needed
Provide code examples and explain the changes.
Update the internal implementation plan with notes and show me the plan so I can track your progress.Q: My new field doesn't appear. A: Make sure you've updated both the API (to store it) and the frontend (to display it). Also, check that you're reading it from the payload or attributes correctly.
Q: How do I query by my new attribute?
A: Add a .where(eq('yourAttribute', value)) clause to your query. Make sure you're storing it as an attribute, not just in the payload.
Q: Can I change the message format for existing messages? A: No, existing entities can't be modified. But new messages will use the new format. You can handle both formats in your code for backward compatibility.
Q: How do I add validation? A: Add validation in the API route before creating the entity. Return an error response if validation fails.
Q: Can I add images or files? A: Yes! You can store binary data in the payload. For large files, consider storing a hash on-chain and the file on IPFS or similar.