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

Any reason books is not part of the Author model? #17

Open
dgtlmonk opened this issue Sep 15, 2019 · 1 comment
Open

Any reason books is not part of the Author model? #17

dgtlmonk opened this issue Sep 15, 2019 · 1 comment

Comments

@dgtlmonk
Copy link

Hey! Awesome tutorial and loving this.

Just a question and probably a suggestion.

const authorSchema = new Schema({
name: String,
age: Number
});

For clarity purpose, any reason books is not part of Author model? Since, books can be part of the graphql query.

e.g.

const authorSchema = new Schema({
    name: String,
    age: Number, 
    books: Array
});

GQL query

{
  author(id: "cdf0506f8f561f87c1d8d140") {
    name
    books {
      name
    }
  }
}
@dgtlmonk
Copy link
Author

Let me know if this is reasonable and i'll send PR :)

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