{"library":"graphql-directive-auth","type":"library","category":null,"description":"graphql-directive-auth is a utility library designed to simplify common authentication and authorization tasks in GraphQL APIs by providing schema directives. It offers `@isAuthenticated` and `@hasRole` directives, which can be used to protect fields and types based on JWT tokens and user roles. The current stable version is 0.3.2, indicating it's still in a pre-1.0 development phase, which typically implies an irregular release cadence and potential for API changes. Its key differentiators include a straightforward setup with environment variables for default behavior and highly customizable authentication and role-checking functions for more complex scenarios. It ships with TypeScript types, enhancing developer experience in TypeScript projects. It integrates with `graphql-tools` and expects a `graphql` peer dependency, providing a declarative approach to security within the GraphQL schema itself.","language":"javascript","status":"active","version":"0.3.2","tags":["javascript","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install graphql-directive-auth","imports":["import { AuthDirective } from 'graphql-directive-auth';","import { AuthDirective } from 'graphql-directive-auth';\n// ...\nauth: AuthDirective().isAuthenticated","import { AuthDirective } from 'graphql-directive-auth';\n// ...\nrole: AuthDirective().hasRole"]},{"cmd":"yarn add graphql-directive-auth","imports":[]},{"cmd":"pnpm add graphql-directive-auth","imports":[]}],"homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/graphql-directive-auth","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/graphql-directive-auth/compatibility"}}