Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
capaj opened this issue Apr 28, 2019 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@capaj
Copy link
Owner

capaj commented Apr 28, 2019

  @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 capaj added the enhancement New feature or request label Apr 28, 2019
@capaj capaj added this to the 0.9.0 milestone Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant