marmelab / marmelab/json-graphql-server

Support many-to-many relationships

Open
#29 2 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
JavaScript
Stars
1.9k
Forks
166
Avg merge
3m
Merged PRs (30d)
3

Description

It seems that I can't do this right now:

```js
module.exports = {
posts: [
{ id: 1, title: "Lorem Ipsum", views: 254, user_id: [123, 456] },
{ id: 2, title: "Sic Dolor amet", views: 65, user_id: [456, 457] },
],
users: [
{ id: 123, name: "John Doe" },
{ id: 456, name: "Jane Doe" },
{ id: 457, name: "Xavier" }
],
comments: [
{ id: 987, post_id: 1, body: "Consectetur adipiscing elit", date: new Date('2017-07-03') },
{ id: 995, post_id: 1, body: "Nam molestie pellentesque dui", date: new Date('2017-08-17') }
]
}
```

Is this not supported? or maybe there's a different way of doing it?

p.s.: this would be something like a combined authorship post. This is not my actual use case though, but close enough to show the problem and with a little change of the provided example.

p.s. 2: great tool, keep it up :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the relationship shown in the issue body against the repository's generated GraphQL API and compare it with the existing relationship examples, if any. Determine whether many-to-many relationships are intended to be supported or documented as unsupported; done means the expected behavior is implemented and verified, or the limitation and alternative usage are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, javascript
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.