entria / ReactNavigationRelayModern

React Navigation integration with Relay
173 stars 23 forks source link

GraphQL documents #1

Closed ghost closed 7 years ago

ghost commented 7 years ago

What documents should we add to the database to make this work with https://github.com/entria/graphql-dataloader-boilerplate ?

I have this document in my user collection, but UserList always shows up as empty.

{
    "_id": "507f1f77bcf86cd799439011",
    "name": "someuser",
    "email": "someuser@mail.com",
    "active": true
}

Any ideas? Thanks

sibelius commented 7 years ago

U can use the REPL of graphql-dataloader-boilerplate to add some users to your server (https://github.com/entria/graphql-dataloader-boilerplate#repl-server)

something like this:

yarn repl
awesome > new M.User({name: 'someuser', email: 'someuser@gmail.com', password: 'somepassword'}).save()
sibelius commented 7 years ago

@Lenin7 did this solved your problem?

ghost commented 7 years ago

Relay refuses to get data from the GraphQL server for some reason. I get no errors or warnings, and it's basically stuck in the "loading" icon.

I'v only tested this on Windows/Android so far. Not sure if it's related. I'll test this on Mac/iOS in a few hours and let you know

sibelius commented 7 years ago

u need to use adb reverse on android

try to use ip of your machine instead of localhost

ghost commented 7 years ago

It's working now. I had a typo in my mongodb documents. Thanks!