-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
Pure GraphQL-compliant version #74
Comments
What do you think that would look like? I’m super open to ideas, but at the moment I don’t necessarily think of it as “Relay GraphQL,” but rather idiomatic GraphQL. The Relay specs are pretty good and well thought out. I feel like The one thing I would like when dropping Relay support is not having to rename |
I feel there's an impedance mismatch between the GraphQL spec/docs and PostGraphQL. IMHO Global Object Identification is definitely only part of the Relay spec, and definitely muddies the waters.
I'm super excited about this project, and I applaud the effort you have put into it, it really is amazing. I agree that Relay is well thought out. I also agree with all of your arguments about No Lock In and Schema-driven APIs, but I don't feel that's being achieved. If I write my software against PostGraphQL's idiomatic GraphQL, I am locked in; I can't switch to a reference implementation of GraphQL. Although I don't necessarily dislike these additions, I do feel they should be additions. P.S. As a side issue, |
Part of what confuses me about this is that Relay additions are pure GraphQL. The Relay additions are simply a way to structure the GraphQL API. The GraphQL spec is amazing in this way. It can be used to create any API. One of my favorite examples of this is gdom a GraphQL HTML parsing API. So there's no mismatch between GraphQL/PostGraphQL. Only an opinionated GraphQL structure (which is kinda unavoidable). At least our opinions are the current GraphQL idioms and are easily and quickly translated to other GraphQL frameworks.
I agree, and This pattern was taken from the SWAPI GraphQL API as it was one of the first GraphQL implementations. Except where we have I feel like much of this issue all boils down to a distaste for the I don't want to alienate users because of Relay support, but I also don't see a use for a field which only returns a list with no connection as pagination is wanted like 90% of the time. I also don't want to remove global object identification, because that's how almost every GraphQL framework is able to normalize data and build a proper cache. So what do you think about the compromise of adding a pluralization library to get |
As a non-relay-user and relatively new PostGraphQL user (and contributor, thanks to @calebmer thoughtful reviews and time), I can relate to @JurgenJocubeit point of view: the relay opinionated decisions get in the way of getting started with the awesomeness of PostGraphQL. Having a Relay-compatible API available is great, as I understand that Relay is a package of GraphQL API best practices from the trenches but it adds a non trivial amount of complexity that might not be necessary for everyone. The main problem I had while getting started with PostGraphQL was getting around the
From what I understand, the global object id is a Relay addition so that shouldn't be the case if those frameworks support non-Relay GraphQL APIs.
IMHO It's not that I can't get those concept, it's just that I identify those as being unnecessary complexity for users that just want a quick and straightforward GraphQL api from their db.
Agreed, we all know that pagination is hard and that Regarding PostGraphQL, my opinion is that we should run a "non-Relay" mode by default that maps SQL to GraphQL in a simple way to have a smooth learning curve and add |
Ok, so could we get a list of things we would want from a After that, we can assess complexity and look at how to integrate with the current codebase. |
This might be an interesting read for participants in this thread: facebook/relay#1061 Specifically this comment: facebook/relay#1061 (comment) GraphQL is planning to standardize the global identification pattern by using an Just another note, before anyone does work on this issue, they should share their full plan. If at all possible I would prefer finding a way to marry the two styles into one API instead of fragmenting it. |
Awesome work on the I put some thought into the target design and I've come to the conclusion that a As a first step I suggest that we add
Or an alternative that does not leak the underlying SQL storage abstraction:
|
Currently, we do offer limit/offset pagination using the arguments |
Oh, I did not know that. I would then add an example in the README to point non Relay users and new GraphQL users the direction they should look at. Something like this:
|
Reading the GraphQL id struggles you've been fighting since April gives me heart. It's an interesting thread and your concerns are very closely aligned with my thoughts. I probably just didn't know how to express them. Bravo for getting Facebook to consider Just a side thought, would it be possible to create an extension like As another side note, I really like the anonymity |
@JurgenJocubeit my favorite solution to this problem is the If a PostgreSQL UUID extension has the ability to select a single row and give us type information (table) then we could adopt that approach. |
Just to make it clear for a beginner like me, when designing a new database to be used with your library, is it recommended to use |
@meglio nah, use |
I’m going to close this as I feel like much of the ‘features’ that were obtrusive for non-Relay users have been either removed or reworked.
If there’s anything else that exists to support Relay that you feel is too obstrusive, let me know! I definitely don’t want to alienate non-Relay users especially now that Relay 2 will probably make a lot of the Relay 1 specifications irrelevant 😉 |
…ull default (#74) * add breaking test for inserting explicit “null” values * add test for null behavior in update mutations * Fix setting null on create for nullable column with default
Have you thought about just making a pure GraphQL version, sans-Relay?
Maybe making Relay-compliancy an option or add-on?
The text was updated successfully, but these errors were encountered: