Comments (11)
from relay-angular.
Hi Lorenzo, I am glad you elaborated how you started the apps, that pinpointed a huge blind spot on my part; things work correctly now :-) With that, I think the issue I described can be closed.
The other points I mention along the way could maybe be adressed in a new issue, but until then:
I added a commit to my sample project, it's pretty artificial but I hope it does get its point across. I added some explanation to the commit, let me know if it makes sense to you.
from relay-angular.
Hi @waldogit,
could you give me more details about your problem?
In the example project I created the relay.config.js file reads correctly
from relay-angular.
from relay-angular.
@waldogit it is always a pleasure to meet people who try new libraries and open issues to help improve them :)
To better analyze your problem, the example project would be very useful :)
from relay-angular.
from relay-angular.
I notice you switched off aot: is that a requirement? That is a serious limitation :-(
I honestly have not tried compiling aot in case there were any problems we could try to fix them!
Can the fragmentRefs come in in another way then as @input? I would like to
pass the fragmentRef as an angular route param. Can i resolve that route
param in ngOnInit, or will that be too late for the fragmentDecorator
function?
yes, you can do it
As for your sample project, I'll do some tests as soon as possible (I'm on vacation now) :)
from relay-angular.
@waldogit I tried your sample project and i created a PR waldogit/relay-angular-config#1 which allows it to be started.
Let me know what you think.
Lorenzo
from relay-angular.
from relay-angular.
Hi @waldogit,
I ran the application with yarn start (ng serve --plugin relay-angular-plugin)
in the root.
Otherwise, nx serve relay-angular-config --plugin relay-angular-plugin
is fine too.
I didn't understand the use case described here:
In your example, the answer is yes
because the query itself is resolvable from the query's own fragmentrefs.
But let's say I have a subcomponent that gets some ID from a route param.
Then I face 2 problems:1) AFAIK I should not pass a fragment ref, but an
argument definition. But that is not included in your API, is it?2) I guess
the roundtrip should be issued via a Query decorator, but how does that
query component know about the fragment of the other sub component? If I
look into the code, In react (of which i have 0 experience) there is
https://github.com/facebook/relay/blob/master/packages/react-relay/ReactRelayFragmentContainer.js.
Ideally there would be an equivalent of that in relay-angular - but that
does not sound simple. The alternative is that the application keeps track
of those. That becomes cumbersome: if a route param has several route
targets as children, then all those children need to reference that
fragment.
Can you show me in the sample project?
Thanks
from relay-angular.
It works, as you said! I am glad there is no race condition with resolving the fragment id. But the remaining issue is: pressing the 'Combine' leads to 2 roundtrips, one for the combinedQuery and one for the todoQueryQuery. How can they be bundled into a single roundtrip?
from relay-angular.
Related Issues (12)
- check subscription when changing user
- Testing using karma
- create the documentation and publish the github page HOT 1
- parameterised decorator's incompatible with Ivy HOT 1
- Bundle roundtrips without using fragmentRefs HOT 1
- create tests
- Update the documentation as written in the post on Medium
- support relay-runtime v13 HOT 1
- update to angular 11 HOT 1
- create a logo for relay-angular
- offline first application - wora/relay-offline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relay-angular.