-
-
Notifications
You must be signed in to change notification settings - Fork 576
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
GraphQL syntax for simple join? #220
Comments
{
postById(id: 1) {
personByAuthorId {
firstName
lastName
}
}
} I'm hoping to add some example queries to the docs soon, hope this helps 😊 |
Indeed that query was just what I was hoping to see, thank you very much. I'm an old Postgres hand, but very new to GraphQL. |
@calebmer Sorry I re-opened this. The query works perfectly, but where did If it is auto-generated by Postgraphql, then the question becomes, "How does one discover the full set of such queries/mutations available?" Thanks, hope I'm not being a PIA. |
Yep, PostGraphQL generates it all, but you can find all the documentation in GraphiQL. By default when you start PostGraphQL you can find GraphiQL at Start typing a query and hit |
I've been using GraphQL for almost a year. I'm not an advanced user but "familiar." I'm stuck on how some of the things happen internally, and personByAuthorId is a perfect example. I want to understand how it, and its attendant comment, got auto-generated by Postgraphql. In other words, how would I know when looking at the forum_example table structure that a result of that design would be that particular query, and that particular comment "Reads a single Person that is related to this Post." That wasn't a comment anyone entered during the tutorial and it's not in a database dump of the project schema. How did Postgresql know how to generate it? I'm trying full-time ATM trying to understand everything, but I get hung up on things like this in my discovery, and the central question, "How do you set up your tables to auto-generate the GraphQL part, and how do you know the identifiers of the generated GraphQL?" personByAuthorId is a wonderful example of a big sticking point in my efforts. Is there a Slack channel or IRC room for the project? I know it's a burden on your development time to have to stop to answer newbie questions. Sorry for the bother. |
Gotcha, wasn’t sure what exact level of the stack you were looking for 😉. There is a chat channel on Gitter for this project: https://gitter.im/calebmer/postgraphql Now that I understand what you are actually trying to ask, I’ll go a bit more in depth because this is actually a fun question to answer 😊 The GraphQL interface is generated from a core set of interface files which can be found in the These interface objects are generated by the modules found in Our abstract inventory interface (which now has a Postgres implementation) is then consumed by functions in If you specifically want to see the flow of generating the
|
Thanks SO MUCH for the detailed explanation, which is indeed just what I was looking for. I'll for sure e out of your hair for a while as work through all of this. I did understand earlier about the desire to have a generic "abstraction matchup" platform. I'm not a big enough boy yet to fully absorb the details, but I'm working on it as hard as I can. Thanks again. |
This is super informative; I've created a wiki page for this answer: https://github.com/calebmer/postgraphql/wiki/Code:-how-are-things-like-barByFooId-built%3F I think after a small amount of editing we should consider adding links out to stuff like this from https://github.com/calebmer/postgraphql/blob/master/src/README.md Nice one Caleb! 👏 |
* Reproduce issue * Fix issue * Fix handling of null entries * Handle complex nulls via __isNull * Add some comments
I am very new to GraphQL/Relay and if these questions aren't appropriate as issues just let me know and I'll find another venue.
I've already figured out how to do this when I can write my own GraphQL schema; the automatic mapping from the relational tables is still a mystery to me.
How could I do something like this simple join in the Postgraphql environment:
select first_name, last_name from forum_example.person as person, forum_example.post as post where person.id = author_Id and post.id = 1;
The text was updated successfully, but these errors were encountered: