kkemple / graphql-auth

🔒 GraphQL authentication and authorization middleware
MIT License
278 stars 19 forks source link

Fix ambient defintions for TS. #11

Closed ScreamZ closed 5 years ago

ScreamZ commented 5 years ago

Hey,

I missed that the module was doing a export default, typings are wrong atm, this fix ambients types.

Can you release a patch accordingly, thanks :)

Regards

ScreamZ commented 5 years ago

@kkemple Up :)

ScreamZ commented 5 years ago

@kkemple Re-up ;)

mitjade commented 5 years ago

@ScreamZ I also have problems with dynamic scopes like:

import withAuth from 'graphql-auth';

const resolvers = {
  Query: {
    users: withAuth(
      (root: any, args: any, context: any, info: any) => { /* return scope based on resolver args */ },
      (root: any, args: any, context: any, info: any) => { ... }),
    ...
  }
}
ScreamZ commented 5 years ago

@mitjade Oh yes, I never used actually so I forgot, I'll fix this

mitjade commented 5 years ago

@ScreamZ Any chance of taking a look at the problems with dynamic scopes?

ScreamZ commented 5 years ago

@mitjade Yes, I'll look forward, I update this