Commit 38e7a6db authored by aleclofabbro's avatar aleclofabbro
Browse files

readme

parent 7a14ee66
......@@ -4,21 +4,21 @@
### with yarn
yarn install -D
yarn build
yarn start
yarn install -D
yarn build
yarn start
### with npm
npm install -D
npm run build
npm start
npm install -D
npm run build
npm start
### Start a MongoDB instance
Listening on default port 27017 on host
you may want to use docker for simplicity :
`docker run --name mongo-gql --network host -ti mongo`
Listening on default port 27017 on host
you may want to use docker for simplicity :
`docker run --name mongo-gql --network host -ti mongo`
### populate with some data
......@@ -26,24 +26,29 @@ you may want to use docker for simplicity :
### issue queries
Open this nice [online graphql client](https://graphiql-online.com/)
set endpoint to `http://localhost:4001/graphql`
and issue a query
Open this nice [online graphql client](https://graphiql-online.com/)
set endpoint to `http://localhost:4001/graphql`
and issue a query
```
```graphql
query someQuery {
user_knows_user_knows:graph { # for each user
user_knows_user_knows: graph {
# for each user
... on User {
name: username
knows: _rel { # show his known
knows: _rel {
# show his known
... on Knows {
kid:_id
this_user:_obj {
... on User { # users
kid: _id
this_user: _obj {
... on User {
# users
username
that_follows:_rel { # and for each of them show their followed
that_follows: _rel {
# and for each of them show their followed
... on Follows {
this_other_user:_obj { # users
this_other_user: _obj {
# users
... on User {
username
}
......@@ -56,16 +61,19 @@ query someQuery {
}
}
}
followers:graph { # for each Follow
followers: graph {
# for each Follow
... on Follows {
_id
subject:_subj{ # show the following user
...on User{
subject: _subj {
# show the following user
... on User {
username
}
}
target:_obj{ # and the followed user
...on User{
target: _obj {
# and the followed user
... on User {
username
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment