overwrite: true
watch: 'src/**/*.ts'
# documents: "src/**/*.graphql"
generates:
  src/generated/graphql.user.ts:
    schema: 'src/schemas/user/schema.ts'
    plugins:
      - typescript
      - typescript-operations
      - typescript-resolvers
    hooks:
      afterOneFileWrite:
        - npx prettier --write
  src/generated/graphql.workspace.ts:
    schema: 'src/schemas/workspace/schema.ts'
    plugins:
      - typescript
      - typescript-operations
      - typescript-resolvers
      # - add:
      #   content:
      #     - '/* eslint-disable @typescript-eslint/ban-types */'
      # - "typescript-graphql-files-modules"
      # - "typescript-document-nodes"
    # config:
    #   defaultMapper: Partial<{T}>
    #   interfacePrefix: "I"
    hooks:
      afterOneFileWrite:
        - npx prettier --write
  ./graphql.user.schema.json:
    schema: 'src/schemas/user/schema.ts'
    plugins:
      - "introspection"
  ./graphql.workspace.schema.json:
    schema: 'src/schemas/workspace/schema.ts'
    plugins:
      - "introspection"
  src/generated/client/gen-types.user.ts:
    schema: 'src/schemas/user/schema.ts'
    documents: ./src/queries/user/**/*.ts
    plugins:
      - typescript
      - typescript-operations
      - typed-document-node
      # - typescript-react-apollo
    hooks:
      afterOneFileWrite:
        - npx prettier --write
  src/generated/client/gen-types.workspace.ts:
    schema: 'src/schemas/workspace/schema.ts'
    documents: ./src/queries/workspace/**/*.ts
    plugins:
      - typescript
      - typescript-operations
      - typed-document-node
      # - typescript-react-apollo
    hooks:
      afterOneFileWrite:
        - npx prettier --write
require:
  - ts-node/register/transpile-only
  - tsconfig-paths/register
