On this page

Hasura Allow List

Generate hasura allow list metadata from graphql files.

Version
4.0.1
Weekly downloads
1k
License
MIT
Updated
Apr 19, 2026

Installation

          npm i -D @graphql-codegen/hasura-allow-list
        

Config API Reference

collectionName

type: string

Choose the collection name to be generated. Defaults to allowed-queries Default value: “allowed-queries”

configVersion

type: number

Target metadata config version. Supported versions are 2 and 3. This is mostly for future proofing, currently has no impact as both versions use the same format. The default value will change in the future if/when newer config versions are released. Default value: “3”

globalFragments

type: boolean

Whether to source fragments per-document, or globally. If set, will enforce fragment name uniqueness Default value: “false”

fragmentsOrder

type: string

Whether to order fragments by global definition order, or by definition order in the document Default value: “definition”

Generate hasura allow list metadata from graphql files

You can use this plugin to generate an allow list for your hasura project.

This can be useful to keep your allow list and front end code in sync.

Examples

codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  // ...
  generates: {
    'path/to/metadata/allow_list.yaml': {
      plugins: ['hasura-allow-list']
    }
  }
}
export default config