Does the line ```# import Post from "./generated/p...
# orm-help
a
Does the line
Copy code
# import Post from "./generated/prisma.graphql"
in schema.graphql do anything? If I remove it i get errors. I'm using the standard node-advance boilerplate from graphql create
n
yes, it imports the
Post
type from
./generated/prisma.graphql
🙂
a
I found it a little confusing becuse I didn't need to add anything when adding new types to the datamodel
k
It's an import that allows your schema to use the type Post. The generated prisma.graphql is very important. Without that import it wouldn't know what "Post" meant. Look in that generated file for "type Post". If you define new types in your own schema then that's all where it's defined.
👍 1
n
@ameistad are the other types related to
Post
by any chance? 🙂 importing is transitive, so that might explain it
k
It's also an interesting idea to consider when you might want to define your own slightly different Post type in your schema. For example, the User type has the password field. In my server I personally defined a new type User without that password field and removed my import for User from the generated file.
💡 1
n
that's indeed a common pattern, thanks for sharing @KyleG!
a
@nilan: Yes, I had a one to many relation. So that might be it.
Well it works now, and I learned soemthign 🙂 Thanks guys
🙌 1
k
Just feel like sharing, I hope this could give you an idea. But here, in my little practice project (a movie collection database thingie) I this is generated:

https://puu.sh/AaYAq/76c1e836d0.png

and this is my (two) different kinds of users

https://puu.sh/AaYB9/106f9d55e8.png

(I hide email as well, since I may not want email to be publicly shared when someone, for example, queries a movie's createdBy field (type User))