Hi there,
A little question, I see that this package is supposed to work with SimpleSchema, does it also work with Astronomy ?
Is there someone using it or having a very simple integration?
Hi there,
A little question, I see that this package is supposed to work with SimpleSchema, does it also work with Astronomy ?
Is there someone using it or having a very simple integration?
There is no integration with it, but ofcourse it works. You just have to add the schemas yourself.
Quick Updates
We made Grapher React to work in a recommended HOC manner: https://github.com/cult-of-coders/grapher-react
Grapher 1.3 is on itâs way. It marks a stepping stone in the evolution of data.
The release is almost completed but it needs to be backed by a solid documentation, because this is what discouraged adoption in the past.
We introduce new concepts such as:
And iterate on previous ones:
In my opinion, Grapher is outperforming GraphQL in Meteor at almost any level:
MDG: While we have no plans to force existing Meteor applications to be rewritten to use Apollo and/or GraphQL, we believe that migrating away from Mongo and Livedata is the right path forward for most applications, and certainly the right place to start for newcomers to the Meteor platform.
Iâm sure they will change their mind about that statement.
Thanks yet again @diaconutheodor for awesome packages like Grapher!!
I am waiting for the 1.3 release and planning to completely switch over to Grapher in January!
If I may, I have a little feature request:
It would be friggin awesome, if Grapher supported some kind of offline functionality. My Meteor app is often used on mobile devices, where Internet connectivity is not very stable and might not be available for some seconds/minutes until reconnect. I would be just awesome if grapher could cache Mongo writes in the meantime somehow and send them after reconnection?!
@klabauter Grapher is not a complete Data Layer, itâs a Fetching Layer on top of Meteor Data Layer. Meaning you will only use it to consume data, and not mutate it.
Regarding offline capability, Grapher works behind the scenes through methods and publications. So, in theory, you have the same offline capabilities as Meteor does.
Thanks for clarifying @diaconutheodor!
I just found something which might be pretty easy for you guys to implement into grapher-react
: https://hackernoon.com/offline-first-react-native-meteor-apps-2bee8e976ec7
I am aware this is only some sort of cache, but still - might be a nice feature for grapher-react
.
Thank you for the suggestion. The 1.3 release is focused on completing Grapher as a data fetching layer inside Meteor Appsâ Frontend.
1.4 will be focused on a wider approach, moving grapher clients to npm, exposing end-points easily, authorization with Meteor accounts. You can still use this quite easily inside React-Native, all you have to do is expose an HTTP point that accepts JSON Requests and inside it you can createQueries and return the result.
I should have clarified a bit better:
I am not using react-native ⌠I wanted to show you the âclientside data cacheâ via redux as proposed in the article. It is just a few lines of code and might be a nice way to have a clientside caching functionality in grapher-react
.
Please just take 5mins and read the article briefly ⌠maybe Grapher already has something like this included but it seems to make proper sense to me to cache fetched data on the client and make it available, even if the client is offline.
Hmm, so he uses redux-persist to save the Redux state to localStorage. You could easily do this yourself with Graphers nonreactive queries, but the reactive ones rely on MiniMongo. Ground:db offers persistence for MiniMongo, but only for client-only collections
Yeah I know itâs not really rocket science what this guy is doing in the article!
The thing is: I donât really have any client-only collections, I need offline support for my normal collections. The optimal way would be to save all minimongo writes somewhere and send them to the server when the client is back online.
Talking about the fetched data (so only reads, no writes): having the data in a persistent Redux state sounds pretty nice no?
Hi everyone!
I was wondering if this kind of filtering is possible with Grapher.
Letâs say we have two collection with a 1-N relationship called âCompaniesâ and âEmployeesâ where the Employees have a boolean type field called for example âisHardworkerâ. Can I somehow fetch only the companies (without fetching any of itâs employees!) that have at least one hardworker employee?
@diaconutheodor
Iâd like to thank you for the great tool Grapher. I think it is the big thing inside Meteor ecosystem.
I can not imagine Meteor without it as it made joining and querying decoupled and easy.
It should part of Meteor because even if you want to use Apollo youâd need a relationship manager.
The stack (React + Meteor + Grapher + Denormalize + Apollo) is unbeatable
Keep up the good work.
Very glad you are using Grapher together with Apollo, it makes a lot of sense, and you could easily transform a GraphQL query to Grapher, nice!
I hope itâs okay to post this in here ⌠if not please tell me so and delete this post!
After defining a link between two collections like so:
OpenOrdersBody.addLinks({
'item': {
type: 'one',
collection: Items,
field: 'itemId'
}
})
Items.addLinks({
'openorderitems': {
collection: OpenOrdersBody,
inversedBy: 'item'
}
})
and then querying the OpenOrderItems
like so:
const myQuery = OpenOrdersBody.createQuery({
$filter({filters, options, params}) {
filters.list_id = params.listId;
},
_id: 1,
list_id: 1,
item_amount: 1,
item: 1 // adding this line produces the error below
});
...
withTracker((props) => {
return {
supplier: Meteor.users.findOne({ _id: props.supplierId })
}
})
I get the following error:
error: "invalid-body", reason: "Every collection link should have its body defined as an object."
What am I doing wrong? I thought I defined my link properly and now I just want to âquery for this linkâ ("item
").
Itâs advisable to do this in GitHub. And have high-level discussions here.
item: { fieldName: 1, fieldName2: 1 }
Would you be willing to setup a quick repository to show how Grapher is used with Apollo ? I know in theory that they should play well together but maybe help us see it better.
Cheers!
@diaconutheodor
Sorry for the late reply I just saw your message.
Yes sure Iâll try to setup the repository this weekend. I already have a project Iâll extract something from it.
Hi everyone, I hope itâs okay to link another thread in here. Itâs about a question/problem that I have about denormalization and querying in grapher.
Hi @diaconutheodor,
I have a collection with dynamic fields. Is there a way to bypass having to specify the fields that need to be returned in a query?
Thanks,
Chat.