Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cryptic error when no explicit type is neither in field config and neither in TS return type #27

Description

@capaj
  @Field()
  edit(name: string) {
    this.name = name
    return this
  }
Error: Class Function cannot be used as a resolve type because it is not an @ObjectType
    at Object.resolveType (/home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/services/utils/gql/types/typeResolvers.ts:73:11)
    at Object.inferTypeOrThrow (/home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/fieldType.ts:60:10)
    at Object.resolveRegisteredOrInferedType (/home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/services.ts:24:10)
    at compileFieldConfig (/home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/fieldCompiler.ts:26:24)
    at /home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/fieldCompiler.ts:67:35
    at Array.forEach (<anonymous>)
    at getAllFields (/home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/fieldCompiler.ts:56:23)
    at /home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/fieldCompiler.ts:76:35
    at Array.forEach (<anonymous>)
    at Object.compileAllFields (/home/capaj/oss/graphql-repos/typegql/examples/nested-mutation-or-query/node_modules/decapi/src/domains/field/compiler/fieldCompiler.ts:75:21)
npm ERR! code ELIFECYCLE

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions