decapi icon indicating copy to clipboard operation
decapi copied to clipboard

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

Open capaj opened this issue 6 years ago • 0 comments

  @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

capaj avatar Apr 28 '19 01:04 capaj