Skip to content

TypeError: visitFn.call is not a functionΒ #69

Closed
@TokiyaHorikawa

Description

@TokiyaHorikawa

Thank you for making this plugin! .🌸
Share about the errors I encountered.

This error when I did yarn codegen.

βœ– ./graphql/mock.ts
    TypeError: visitFn.call is not a function

I dropped "grapql" from v16 to v15.8.0 and it ran fine.

This is my schema:

overwrite: true
schema: ${API_URL}/graphql
documents: 'graphql/**/*.graphql'
generates:
  ./graphql.schema.json:
    plugins:
      - 'introspection'
  ./graphql/graphql.ts:
    plugins:
      - 'typescript'
      - 'typescript-operations'
      - typescript-react-query
    config:
      fetcher: graphql-request
  ./graphql/mock.ts:
    plugins:
      - typescript-mock-data:
        typeFile: './graphql/graphql.ts'
        addTypename: true
        prefix: 'mock'
        enumValues: pascal-case#pascalCase
        typename: keep
        terminateCircularRelationships: true
        scalars:
          BaseDateTime:
            generator: date
            arguments: 'YYYY-MM-DD'

Link of issue of another repository that I referred to
croutonn/graphql-codegen-plugin-typescript-swr#179

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions