-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Query composition #148
Comments
Never mind - Abhi was talking about resolver composition. False alarm! |
To add more detail to this issue, this includes:
This is important to be able to co-locate your data requirements with the components, without having a performance impact on your app's first load. |
Would this include some abstraction from the GraphQL String notation? I mean I'm not sure I'd want a full-blown ORM here, and perhaps a simple String is still the most efficient way, but if we're just talking about small fragments, that then need to be composed in some way, I wonder if an Object-based API might be better here? |
I feel like GraphQL query strings are the best part of the whole system, but perhaps it would be a good idea? What would be the benefit of an abstraction other than fragment strings? |
I'm thinking of scenarios where one would want to dynamically create these fragments from a bunch of options at runtime. Yes, we could just use string interpolation, and perhaps that's best and I'm thinking too traditionally, here. |
Oh that's what the skip and include directives are for! I think the best practice is to never use string interpolation on queries, which would be pretty easy to check with a longer. |
*linter |
I thinking keeping Apollo 100% graphql spec for query formation (aka just strings) is the best move. It reduces the barrier to entry to the project and we can help mlve the spec forward if / when needed |
Yes, I suppose. That would work for me. However, the approach assumes a lot of knowledge of GraphQL syntax. I know developer friendliness will be tackled later, but providing an API for these things might help those who are new to the GQL spec and just want to make use of Apollo's reactive data etc. |
Although I have little to say here, I would also put forward a 👍 to sticking to the specs. Scott |
Personally I feel like skip and include aren't much harder than string interpolation with an if statement, plus we can more easily do query validation if there isn't interpolation everywhere. |
@stubailo Yes, fair point. |
Is there any update / timeline / milestone for that feature ? This is one of the strong point of Relay, should Apollo Client be able to provide query composition, I expect it will be a huge help to increase adoption. |
That's great news, thanks for the update ! |
This was merged some time ago with |
Added the ``` to the bottom of the page, github renders it fine without but the docs break.
change implied query name to reduce confusion
Tied in with #80
Pinging @abhiaiyer91 who said he had some ideas and talked to @helfer
The text was updated successfully, but these errors were encountered: