Skip to content

Error while using typescript-mongodb with ts-node. #5256

Answered by ardatan
GiridharKarnik asked this question in Q&A
Discussion options

You must be logged in to vote

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;

import { DIRECTIVES } from '@graphql-codegen/typescript-mongodb';

const server = new ApolloServer({
    typeDefs: [DIRECTIVES, './schema.graphql'],
    resolvers
});

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by GiridharKarnik
Comment options

You must be logged in to vote
1 reply
@ardatan
Comment options

ardatan Dec 14, 2020
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants