Enum column plugin: does this look right?
### Summary

Benjie "it's better in V5!" — Today at 3:34 PM
Right, you should be getting the codec in a different way. File an issue and I’ll take a look when I’m back and settled.

```typescript
import type { PgCodec, PgCodecAttribute, PgCodecAttributes } from "@dataplan/pg"
import { isPromiseLike } from "grafast"
import type { PgAttribute } from "graphile-build-pg/pg-introspection"

const replaceCodec = (
  pgCodecs: {
    [name in string]: PgCodec<
      name,
      PgCodecAttributes | undefined,
      any,
      any,
      any,
      any,
      any
    >
  },
  pgAttribute: PgAttribute,
  attribute: PgCodecAttribute<any>,
) =>
  pgAttribute
    .getClass()
    ?.getConstraints()
    .filter(
      (_) =>
        _.getAttributes()?.every((_) => _ === pgAttribute) &&
        _.getTagsAndDescription().tags["enum"] === true &&
        _.getTagsAndDescription().tags["enumName"] != undefined,
    )
    .map((_) => {
      const enumName = _.getTagsAndDescription().tags["enumName"]

      if (typeof enumName === "string") {
        const codec = pgCodecs[`${enumName}Enum`]

        if (codec != undefined) {
          attribute.codec = codec
        }
      }
    })

export const EnumPrimaryKeyPlugin: GraphileConfig.Plugin = {
  name: "EnumPrimaryKeyPlugin",
  version: "0.0.0",

  gather: {
    hooks: {
      pgCodecs_attribute(info, event) {
        const { attribute, pgAttribute } = event
        const pgRegistry = info.helpers.pgRegistry.getRegistry()

        if (isPromiseLike(pgRegistry)) {
          pgRegistry.then(({ pgCodecs }) =>
            replaceCodec(pgCodecs, pgAttribute, attribute),
          )
        } else {
          replaceCodec(pgRegistry.pgCodecs, pgAttribute, attribute)
        }
      },
    },
  },
}
```