Ok, well… I don’t see the point of discussing so much.
What I advocate is let real use cases inform a useful implementation, instead of getting too caught up in concepts and abstractions. I think this is how Meteor developed, it evolved slowly based on real needs, real use cases, not by some standards or “architectures” like Flux and Relay.
GraphQL subscriptions sounds like a wonderful idea. I’m still not sure why “Relay” is needed for this. Why don’t you code something up that builds upon kadira:graphql and uses DDP for subscriptions? Whether or not you implement Relay is up to you, but subscriptions are needed either way, and the API and implementation can be adapted and tweaked later.
Less talking and more coding
Also thanks for the suggestions, I don’t know Mongo.Collection(‘foo’, simpleSchemaMap, true), what exactly is simpleSchemaMap in this case?
i got this error when called from other client app: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 500. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Sorry if this is a silly question, blame it on the js world going faster than light at the moment
I’m just wondering where to place GraphQL exactly? What is it? Is it just another ORM like package? What’s it’s point? To me it just feels a whole can of worms on itself, but for what purpose. Is it comparable with something like https://github.com/balderdashy/waterline?
I’ll take a crack at answering your question @Ben. I don’t know how familiar with you are with Meteor, if you’re familiar with the Meteor story, and specifically the data layer, think of it as an alternative data layer, similar to Meteor’s in some ways, but different.
GraphQL is a general spec that can hook up to many different DBs. In this case @arunoda shows in his demo how to hook up GraphQL to Meteor Collection API (on the server). But it could be something else like SQL.
Then on the client kadira:graphql uses this new Lokka library, which is basically a cache plus some utilities to help you work with GraphQL. Think of Lokka as an alternative to minimongo.
The biggest thing that GraphQL is missing now is publications/subscriptions, basically a way to push new data to the client automatically (which is one area where Meteor shines). Also it may be a little more verbose than Meteor, think of it like a statically-typed language whereas Meteor favors a dynamic language. So it may have some tradeoffs in productivity vs quality of code and performance.
I agree with you 100%, this is really important! However, I think you reversed the companies.
Meteor was designed from scratch with assumptions about how most people would build their app. The core was decided on on day 1, with slight changes made over time. It wasn’t extracted out of a running production app (like Rails was). This is fine, but statistically you’re going to guess wrong on some things.
Flux was made in house and then it was extracted as a set of patterns. It’s made to help solve sharing transient data between React components (because they can’t reach out to siblings/parents like Blaze does).
Both flux, GraphQL, and Relay were built out of their own needs and were open sourced.
At any rate I think GraphQL is a really nice outlook on data access and can solve issues for certain companies. Using pub/sub is still going to be the best bet for day 1.
But, even if Meteor had an original vision of how development should work, I think they still evolved that vision quite gracefully to adapt to real needs.
Maybe: Meteor evolved out of RAD development/prototyping need, whereas React/flux/relay evolved out of a need for developing massive scalable app. For me, Flux seems too beaurocratic, I prefer Meteor way, as long as performance is ok.