other
hasura-allow-list

Hasura Allow List

Package nameWeekly DownloadsVersionLicenseUpdated
@graphql-codegen/hasura-allow-list (opens in a new tab)DownloadsVersionLicenseJul 22nd, 2023

Installation

pnpm add -D @graphql-codegen/hasura-allow-list

Generate hasura allow list metadata from graphql files

You can use this plugin to generate an allow list (opens in a new tab) for your hasura (opens in a new tab) 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

Config API Reference

collectionName

type: string default: allowed-queries

Choose the collection name to be generated. Defaults to allowed-queries

configVersion

type: number (values: 2, 3) default: 3

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.

globalFragments

type: boolean default: false

Whether to source fragments per-document, or globally. If set, will enforce fragment name uniqueness