how can i get a communities name
based off this
i am doing this in my tsx
i have the rack in my console log and it is showing the right amount of racks.. just nott getting the communities name
6 Replies
Hi @Anddy. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain information about accessing a community's name from a rack object in Wasp. It would be helpful to know more about how your data is structured and how the
rack
and community
objects are related in your application.
However, in general, if rack.community.name
is not returning the expected value, it could be due to a few reasons:
1. The community
property might not be populated in the rack
object. You might need to adjust your query to include this information.
2. There might be a typo or case-sensitivity issue with the property names.
3. The community
property or the name
property might be null
or undefined
.
You might want to check these potential issues in your code. If you're still having trouble, I recommend referring to the Wasp documentation (https://wasp-lang.dev/docs) or asking for help in the Wasp community.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Anddy, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?this is my rack table in prisma
This will depend on how you got those
racks
. You did it via query I guess? In tha tQuery, you will want to make sure that communities
fields is populated. That is pure Prisma stuff, so you can check their docs or ask GPT for help, but it should be relatively straightforward.Yeah I did it via a query
You are missing
include
probably: https://www.prisma.io/docs/orm/prisma-client/queries/relation-queriesRelation queries (Concepts) | Prisma Documentation
Prisma Client provides convenient queries for working with relations, such as a fluent API, nested writes (transactions), nested reads and relation filters.