Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require('graphql-directive-auth') does not work as intended #16

Open
tcerda95 opened this issue Jan 8, 2019 · 2 comments
Open

require('graphql-directive-auth') does not work as intended #16

tcerda95 opened this issue Jan 8, 2019 · 2 comments

Comments

@tcerda95
Copy link
Contributor

tcerda95 commented Jan 8, 2019

Hello!

I have installed the dependency via npm install graphql-directive-auth and in order to use it I must first retrieve the default property from require('graphql-directive-auth') like so:

const AuthDirective = require('graphql-directive-auth').default;

Which is not how it is specified in the documentation. This does not happen when using the import keyword:

import AuthDirectives from 'graphql-directive-auth';

I believe this has something to do with TypeScripts module bundling.

@chanlito
Copy link

chanlito commented Jan 8, 2019

@tcerdaITBA yeah, I think this lib should put "module": "commonjs" to tsconfig.json

@FluorescentHallucinogen

Is this issue fixed in 4979f42?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants