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

Query by reference #103

Open
ovaris opened this issue Mar 17, 2016 · 2 comments
Open

Query by reference #103

ovaris opened this issue Mar 17, 2016 · 2 comments

Comments

@ovaris
Copy link

ovaris commented Mar 17, 2016

Hi, newbie question here, how can I query by model reference?
I would like to query all Topic-models of certain Forum, my models (simplified):

var Topic = new Schema({
        uuid: {
            type: String,
            index: true,
            unique: true
        },
        title: {
            type: String
        },
        forum: {
            type: ObjectId,
            ref: "Forum",
            index: true
        },
})

var Forum = new Schema({
   title: {
            type: String,
            required: true
        }
});

I would like to

query TopicsByForum{
  topics(forum:"nnn"){
    forum{title}
  }
}
@choyongjoon
Copy link

I made a PR for this issue
#112

@st0ffern
Copy link

st0ffern commented Sep 7, 2016

Dont think this is relay supported.
Why would you have topics as a parent of forum anyways?

Makes more sense if it is like this:

query ForumTopics{
  forum(title:"nnn"){
    topics{
      uuid
      title
    }
  }
}

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

3 participants