Urigo / graphql-modules

Enterprise Grade Tooling For Your GraphQL Server
https://graphql-modules.com/
MIT License
1.3k stars 114 forks source link

Support NodeJS ES Modules #1066

Open dandv opened 4 years ago

dandv commented 4 years ago

I'm trying to use named imports from .mjs files now that modules are no longer experimental and running into the same issue that graphql-tools had:

gm.mjs

import { GraphQLModule } from '@graphql-modules/core';
$ node gm.mjs 
(node:27782) ExperimentalWarning: The ESM module loader is experimental.
file:///home/dandv/gm.mjs:1
import { GraphQLModule } from '@graphql-modules/core';
         ^^^^^^^^^^^^^
SyntaxError: The requested module '@graphql-modules/core' does not provide an export named 'GraphQLModule'
ardatan commented 4 years ago

Currently we don't have Node's ESM support in GraphQL Modules. But we are working on it together with all other libraries we maintain.

Urigo commented 4 years ago

@dandv if you want to help push this forward quicker, the best place to start is making graphql.js compatible with it. Here is a start: https://github.com/graphql/graphql-js/pull/2487