23 Commits

Author SHA1 Message Date
Robert Schäfer
963cbbef32 RemovePostEmotions should return deleted object
@mattwr18 I prefer (I believe it's even best practice) that a delete
mutation should return the deleted object. If you run the delete
mutation again, it should return `null` because there is no object like
that anymore. That way the client knows if a delete mutation has changed
any state in the database.

Also I fixed another bug in the resolver. If your graphql mutation looks
like this:

```gql
mutation {
  RemovePostEmotions(to:{ id:"p15"}, data:{emotion: angry}) {
    from {
      id
      name
    }
    to {
      id
      title
    }
    emotion
  }
}
```

Then you get errors because your resolver does not return the name for
the user or the title for the post anymore. Just use spread operator...
and it's fixed.
2019-08-08 23:51:26 +02:00
Robert Schäfer
f3e545a913 Fix bug: Only add emotions for authenticated user 2019-08-08 23:10:01 +02:00
Matt Rider
39a94a8aac Refactor
- follow PR review by @roschaefer
2019-08-07 14:55:32 +02:00
Matt Rider
b8e1ae0a1c Update user ids 2019-08-06 18:57:27 +02:00
Matt Rider
53af29b5a2 Refactor backend tests
- to use neode and apollo-server-testing
2019-08-06 18:26:39 +02:00
Matt Rider
d795ee50a9 Add backend tests for custom queries 2019-08-06 10:58:30 +02:00
Matt Rider
d1d82a0051 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-02 16:55:54 +02:00
Robert Schäfer
e1bb6ed74e Fix lint 2019-08-02 01:45:36 +02:00
Matt Rider
0a98113c2d Add backend tests for RemovePostEmotions 2019-07-30 13:28:30 +02:00
Matt Rider
3e43539e23 Set up some backend tests for emotions 2019-07-29 17:08:07 +02:00
Matt Rider
16f077fe65 Add authentication tests for AddPostEmotions, emotionsCount 2019-07-16 11:02:43 -03:00
Matt Rider
0d4617399b Fix/add tests 2019-07-09 18:29:31 -03:00
Matt Rider
a875fe0d5e Merge branch 'master' of github.com:Human-Connection/Human-Connection into 967-filter-post-by-category 2019-07-04 20:33:24 -03:00
Matt Rider
c6b261853f Add test for filter posts by category 2019-07-03 19:46:26 -03:00
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
f302961376 Get categories working with UpdatePost, refactor 2019-07-01 18:00:55 -03:00
Matt Rider
865e2c0ec3 Refactor resolver, rename params
- Use one cypher statement

Co-authored-by: Tirokk <wolle.huss@pjannto.com>
2019-06-28 10:17:22 -03:00
Matt Rider
351f258fab Refactor resolver, write component tests
- use UNWIND instead of iterating over categories(cypher magic)
- do not return nested categories on post creation as it's expensive and we don't use
- refactor backend test
- component tests for CategoriesSelect
2019-06-27 16:57:55 -03:00
Matt Rider
d714927315 Set up backend for Post creation with categories 2019-06-26 11:26:44 -03:00
Matt Rider
4407d6648a Add component tests, translations 2019-06-11 15:47:10 -03:00
Matt Rider
5986ab2070 Create Posts with a specified language, or fallback 2019-06-10 17:12:00 -03:00
177e33c022
fixed spec include paths 2019-06-03 19:34:58 +02:00
f78c54a3e8
refactored backend structure 2019-05-31 19:31:39 +02:00