Importing from Folder Other than Node_Modules?

In the app created by meteor create --apollo, there is this line:

import typeDefs from '/imports/apollo/schema.graphql';

It works fine. Here’s the directory structure:

I’ve put the same line in the code for my app:

import typeDefs from '/imports/apollo/schema.graphql';

Here’s my directory structure:

In my app I get the error:

Error: Cannot find module ‘/imports/apollo/schema.graphql’

What am I missing?

Oh I see what it is. The meteor package swydo:graphql takes care of it.

1 Like