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

@graphql-eslint/known-directives - allow specifying extra whitelisted directives #2232

Open
osdiab opened this issue Mar 14, 2024 · 1 comment

Comments

@osdiab
Copy link

osdiab commented Mar 14, 2024

Is your feature request related to a problem? Please describe.

I am using https://github.com/0no-co/gql.tada which introduces an @_unmask directive which isn't in my actual schema. I can't use it without disabling this ESLint rule, which is a bummer

Describe the solution you'd like

allow specifying that @_unmask is allowed in addition to whatever is in my schema

Describe alternatives you've considered

just disabling it when I use it

Additional context

@felamaslen
Copy link

This also applies to directives defined by external modules, i.e. which can't be detected through static code analysis. E.g.

// rateLimit.ts
import { rateLimitDirective } from 'graphql-rate-limit-directive';

const directive = rateLimitDirective();

export const typeDefs = [directive.rateLimitDirectiveTypeDefs];

export const transforms = [directive.rateLimitDirectiveTransformer];

// MyField.ts
export const typeDefs = [
  /* GraphQL */ `
  extend type Mutation {
    myField: MyField @rateLimit(duration: 3600, limit: 100)
  }
  `
];

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

2 participants