7 Commits

Author SHA1 Message Date
Robert Schäfer
10ae4abaae Use neode to bring User mutations under control
This commit takes all backend changes for signup and invite feature. I
was working on these features and removed the generated mutations for
type user along the way.
2019-07-03 15:58:42 +02:00
Matt Rider
758bf215ac Merge branch 'master' of github.com:Human-Connection/Human-Connection into uploads-on-server 2019-05-23 15:26:19 -03:00
cfd0975b24
backend linting 2019-05-23 19:23:03 +02:00
Robert Schäfer
3c22a432e6 Fix lint 2019-05-21 03:08:32 +02:00
Robert Schäfer
4dbf1b2a2c UpdateUser with avatarUpload
This is a curl request from a folder where I have a file `avatar.jpg`:

```
curl localhost:4000/ \
  -F operations='{ "query": "mutation($id: ID!, $file: Upload) { UpdateUser(id: $id, avatarUpload: $file) { id name avatar } }", "variables": { "id": "u3", "file": null } }' \
  -F map='{ "0": ["variables.file"] }' \
  -F 0=@avatar.jpg
```

It uploads the avatar to the public folder. We should

* Write tests
* Change the `user.avatar` url and send it to `/api` in the frontend
2019-05-20 20:35:33 +02:00
Robert Schäfer
81a26e14ff Fix test case, move spec to the right location
@ulfgebhardt: The reason why the test case was failing is pretty
obvious. You forgot to create a user that you want to update. If there
is no user to update, then you get an empty response.

@ulfgebhardt: I moved the spec also in the right directory. You're
testing resolvers, so that's where I moved the `.spec` file.
2019-05-10 17:34:05 +02:00
Robert Schäfer
47d7c615a5 Refactoring: Put all data validations in one place
@ulfgebhardt @mattwr18 @tirokk

Here's how I imagined the data validation middleware. If we roll our own
input validations I would suggest to put them all in one place.

@ulfgebhardt this commit is a great example of how tests can speed you
up: Since I can rely on existing tests, I don't have to check the validations
manually. With tests you can refactor with confidence! 👍
2019-05-10 17:13:54 +02:00