{"id":24886,"library":"acl-graphql","title":"acl-graphql","description":"A GraphQL ACL (Access Control List) transpiler that generates permission-based GraphQL schemas. Version 1.0.0 is the latest stable release. It transforms declarative ACL rules into GraphQL directives and resolvers, enabling fine-grained field-level access control without modifying existing schema definitions. Differentiates from other auth libraries by focusing on ACL-to-GraphQL transpilation rather than middleware-based enforcement.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","acl","graphql","access","list","control","factory"],"install":[{"cmd":"npm install acl-graphql","lang":"bash","label":"npm"},{"cmd":"yarn add acl-graphql","lang":"bash","label":"yarn"},{"cmd":"pnpm add acl-graphql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for GraphQL schema manipulation","package":"graphql","optional":false}],"imports":[{"note":"ESM-only package since v1.0.0","wrong":"const AclGraphql = require('acl-graphql')","symbol":"AclGraphql","correct":"import { AclGraphql } from 'acl-graphql'"},{"note":"Named export for defining ACL rules","symbol":"AclRule","correct":"import { AclRule } from 'acl-graphql'"},{"note":"Function name is camelCase, not PascalCase","wrong":"import { transpileACL } from 'acl-graphql'","symbol":"transpileAcl","correct":"import { transpileAcl } from 'acl-graphql'"},{"note":"Default export also available and preferred","wrong":"import { default as AclGraphql } from 'acl-graphql'","symbol":"default","correct":"import AclGraphql from 'acl-graphql'"}],"quickstart":{"code":"import { AclGraphql, AclRule } from 'acl-graphql';\nimport { buildSchema } from 'graphql';\n\nconst typeDefs = `\n  type Query {\n    user(id: ID!): User\n  }\n  type User {\n    id: ID!\n    name: String!\n    email: String!\n  }\n`;\n\nconst rules: AclRule[] = [\n  {\n    role: 'admin',\n    permissions: ['Query.user', 'User.id', 'User.name', 'User.email']\n  },\n  {\n    role: 'user',\n    permissions: ['Query.user', 'User.id', 'User.name']\n  }\n];\n\nconst acl = new AclGraphql({ typeDefs, rules });\nconst { schema, resolvers } = acl.transpile();\n\nconsole.log(schema); // GraphQLSchema with @acl directives\nconsole.log(resolvers); // Resolvers enforcing field-level access","lang":"typescript","description":"Creates an ACL-transpiled GraphQL schema from type definitions and rules, outputting schema with directives and authorization resolvers."},"warnings":[{"fix":"Update instantiation to use options object: new AclGraphql({ typeDefs, rules })","message":"As of v1.0.0, the constructor signature changed: new AclGraphql({ typeDefs, rules }) instead of positional arguments.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use flat dot notation for all field paths","message":"Rules must use dot notation for fields (e.g., 'User.email'). Nested fields are not supported.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Replace 'permissions' with 'fields' in rule definitions","message":"The 'permissions' field in rules is deprecated since v1.0.0. Use 'fields' instead.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':19 'access':7,42,71 'acl':2,6,28,58,69 'acl-graphql':1 'acl-to-graphql':57 'auth':52 'base':15,66 'control':8,43,73 'declar':27 'definit':48 'differenti':49 'direct':32 'enabl':35 'enforc':67 'exist':46 'factori':74 'field':40 'field-level':39 'fine':37 'fine-grain':36 'focus':55 'generat':12 'grain':38 'graphql':3,5,16,31,60,70 'javascript':68 'latest':22 'level':41 'librari':53 'list':9,72 'middlewar':65 'middleware-bas':64 'modifi':45 'permiss':14 'permission-bas':13 'rather':62 'releas':24 'resolv':34 'rule':29 'schema':17,47 'stabl':23 'transform':26 'transpil':10,61 'version':18 'without':44","created_at":"2026-05-01T13:41:53.592675+00:00","updated_at":"2026-05-01T13:41:53.592675+00:00","problems":[{"fix":"Use ES module import syntax: import { AclGraphql } from 'acl-graphql'","cause":"Using CommonJS require() with ESM-only package","error":"TypeError: AclGraphql is not a constructor"},{"fix":"Pass typeDefs in options object: new AclGraphql({ typeDefs, rules })","cause":"Omitting required 'typeDefs' option in constructor","error":"Error: No schema provided"},{"fix":"Verify field path exists in schema definition","cause":"Rule references a field that doesn't exist in the schema","error":"Error: Invalid rule - path 'User.email' not found in schema"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/acl-graphql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}