-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Naming reverse related fields #502
Comments
dupe of #345 the explanation of how to resolve is here: #345 (comment) Previously we decided that the current behavior is expected but this has come up enough times we might need to revisit. Do you have any suggestions for what behavior you'd find more intuitive? |
for example we could do
a challenge there would be that if the foreign key under |
Thanks for the quick response! I'm inclined towards the first option of making every relationship accessible and encouraging users to rename them. Is it feasible to display the actual column name in this process? Additionally, I've scoured the documentation, searched online, reached out to the Supabase community, and even consulted GPT, but unfortunately, I couldn't find any information on this topic. |
The solution is in docs here https://supabase.github.io/pg_graphql/configuration/#relationships-field but you're right that we should explicitly call out this issue as something it can address if we don't resolve it with the |
Summary
I have a table
customers
that contains two foreign keys (coach
,partner
), which reference its own table. Using GraphQL, I aim to design a query that would allow me to retrievecustomers
along with their associatedcoach
andpartner
, both of which are alsocustomers
. However, the current GraphQL schema only provides a singlecustomers
field oncustomersEdge
, which does not differentiate betweencoach
andpartner
.Instead, my query looks like this, combining both foreign keys under a single
customers
field without a clear way to distinguish between the two roles:Is there a method or workaround to achieve the desired query structure?
Rationale
Creating distinct fields for
coach
andpartner
within thecustomers
query is essential for clarity and to accurately represent the relationships within our data model. This would allow consumers of the GraphQL API to specifically request the data they need and understand the relationships between differentcustomers
.Design
I do not have any known solutions.
Alternatives
Unresolved Questions
The text was updated successfully, but these errors were encountered: