Error while using typescript-mongodb
with ts-node.
#5256
-
Following type-definition throws an error while run using ts-node schema.grapql type User @entity {
id: String @id
name: UserName! @column
email: String! @column
mobileNumber: String! @column
uid: String @column
fcmToken: String @column
accountType: String! @column
signUpDate: String! @column
} error when run with ts-node
I am requiring the const server = new ApolloServer({
typeDefs: ['./schema.graphql'],
resolvers
}); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It isn't related to ts-node. It is a runtime error coming from import { DIRECTIVES } from '@graphql-codegen/typescript-mongodb';
const server = new ApolloServer({
typeDefs: [DIRECTIVES, './schema.graphql'],
resolvers
}); |
Beta Was this translation helpful? Give feedback.
-
I assume there are no plugins currently available which will create mongoose schema and models but rather objects for the native mongoDb driver.. |
Beta Was this translation helpful? Give feedback.
It isn't related to ts-node. It is a runtime error coming from
makeExecutableSchema
(I guess)You should add directives to
typeDefs
;See the docs; https://graphql-code-generator.com/docs/plugins/typescript-mongodb#usage-example
In your case;