Reputation: 13
Here I have a mongoose Schema
name : String,
class : String,
skills : [{ skill_name : String }]
How I do make it on GraphQL inputs ? so I can save them to mongodb
Like
input Students{
name :String!
class :String!
skills : "how to do it in here"?
}
Upvotes: 1
Views: 102
Reputation: 86
Make GraphQL schema of input Student like this
input Students{
name: String!
class: String!
skills: [String!]!
}
However, don't treat GraphQL schema and Mongoose schema the same. One is used for communicating client <-> server, other is used for server <-> database
Upvotes: 1