Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to @link nested entities? #13

Open
smeijer opened this issue Aug 10, 2020 · 0 comments
Open

is it possible to @link nested entities? #13

smeijer opened this issue Aug 10, 2020 · 0 comments

Comments

@smeijer
Copy link

smeijer commented Aug 10, 2020

Taken the example from the grapher docs:

type User @mongo(name: "users") {
    comments: [Comment] @link(to: "user")
}

type Comment @mongo(name: "comments") {
   user: User @link(field: "userId")
   post: Post @link(field: "postId")
}

type Post @mongo(name: "posts") {
    comments: [Comment] @link(to: "post")
}

How would I need to adjust the directives, if Comment was embedded in Post? When I'm removing the @mongo directive from type Comment, Meteor will throw an error mentioning that we can't use @link on types that don't have a @mongo directive.

db.users = [{ _id: 1, name: 'john' }];
db.posts = [{ comments: [{ userId: 1, body: 'hi' }] }];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant