Custom directive for verifying scopes on an api key
<!-- Before opening an issue: if you use `npm` try running `yarn` instead; if
      you run `yarn`, please try running `npx yarn-deduplicate && yarn`. -->

<!-- You can also chat with us on Discord: http://discord.gg/graphile -->

### Summary
I'm building a way to authenticate users via an api key that they generate and can specify scopes that the key is "authorized" to execute something similar to `read:posts`.

I already have the generation and initial verification of the api key, but I'm still missing the verification of the scope and the operation that they are trying to call on graphql for example that they call `getReviews` the verification would decode the key and get the scopes and do the verification, but I'm not sure how to do that my idea is have a custom directive something like `@hasScopes(required: ['read:reviews'])`  that I could add as a comment in the function `E'@hasScopes ... array of scopes..'`

I have already tried to do something like this #745 taking into account this https://github.com/graphile/postgraphile/issues/745#issuecomment-413360385 but if I do this
```ts
builder.hook('GraphQLSchema', (schemaConfig, build) => {    
    return {
      ...schemaConfig,
      directives: [
        ...(schemaConfig.directives || []),
        build.newWithHooks(
          build.graphql.GraphQLDirective,
          {
            name: 'hasScopes',
            locations: ['OBJECT', 'FIELD_DEFINITION'],
            args: {
              required: { type: build.graphql.GraphQLList },
            },
          },
          { isHasScopesDirective: true }
        ),
      ],
    };
  });
```
it throws this error
```
Error: GraphQL schema is invalid:
- The type of @hasScopes(required:) must be Input Type but got: [function GraphQLList].
```

I would like to know if this is the correct approach and how is the connection between my `E''` comment in the db and the directive logic that I want to implement.

Thanks

<!-- Please detail the issue you'd like to discuss. -->

### Additional context
PostGraphile version: 4.11.0
PostgreSQL version: 13.1

<!-- Please provide additional context such as environment versions (including
      operating system, Node, PostgreSQL, Redis, etc. as relevant), software
      versions (from `yarn.lock`) or similar, plugins in use, database schema
      if relevant, bundler (if any). -->
