Cannot determine a GraphQL output type for the "createProfile". Make sure your class is decorated with an appropriate decorator,
Current behavior
I have defined my code as show above, I do a nest build and its generating ok the dist folder, but when I try nest start
[Nest] 29368 - 2020-08-04 11:51:38 AM [NestFactory] Starting Nest application...
[Nest] 29368 - 2020-08-04 11:51:38 AM [InstanceLoader] AppModule dependencies initialized +66ms
[Nest] 29368 - 2020-08-04 11:51:38 AM [InstanceLoader] GraphqlModule dependencies initialized +5ms
[Nest] 29368 - 2020-08-04 11:51:38 AM [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +9ms
[Nest] 29368 - 2020-08-04 11:51:38 AM [InstanceLoader] GraphQLModule dependencies initialized +28ms
(node:29368) UnhandledPromiseRejectionWarning: Error: Cannot determine a GraphQL output type for the "createProfile". Make sure your class is decorated with an appropriate decorator.
at OutputTypeFactory.create (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\factories\output-type.factory.js:19:23)
at handlers.filter.forEach (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\factories\root-type.factory.js:36:49)
at Array.forEach (<anonymous>)
at RootTypeFactory.generateFields (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\factories\root-type.factory.js:34:14)
at fieldsFactory (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\factories\root-type.factory.js:18:101)
at RootTypeFactory.create (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\factories\root-type.factory.js:27:21)
at MutationTypeFactory.create (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\factories\mutation-type.factory.js:15:37)
at GraphQLSchemaFactory.<anonymous> (D:\nestjs-social\node_modules\@nestjs\graphql\dist\schema-builder\graphql-schema.factory.js:41:52)
at Generator.next (<anonymous>)
at D:\nestjs-social\node_modules\tslib\tslib.js:114:75
(node:29368) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:29368) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Input Code
My sumarized model
import * as TypeGraphQL from "type-graphql";
import { Asset } from "../models/Asset";
import { SocialAccount } from "../models/SocialAccount";
@TypeGraphQL.ObjectType({
isAbstract: true,
description: undefined,
})
export class Profile {
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
nullable: false,
description: undefined,
})
id!: number;
@TypeGraphQL.Field(_type => String, {
nullable: false,
description: undefined,
})
status!: string;
I started a few months ago a nestjs project with prisma2 and type-graphql was using the decorators in another way using the desired properties one by one, using the import like this import { Field, Int, ObjectType } from "type-graphql"; instead of import * as TypeGraphQL from "type-graphql"; but I don't know if this library is generating the error, because I'm trying the import one by one and throws the same error... And I have tried to remove the mutations and it throws same error on queries.. Its a bug? Or what I'm doing wrong?
Bug Report
Cannot determine a GraphQL output type for the "createProfile". Make sure your class is decorated with an appropriate decorator,
Current behavior
I have defined my code as show above, I do a
nest build
and its generating ok thedist
folder, but when I trynest start
Input Code
My sumarized model
My resolver
My service
Expected behavior
I started a few months ago a nestjs project with prisma2 and
type-graphql
was using the decorators in another way using the desired properties one by one, using the import like thisimport { Field, Int, ObjectType } from "type-graphql";
instead ofimport * as TypeGraphQL from "type-graphql";
but I don't know if this library is generating the error, because I'm trying the import one by one and throws the same error... And I have tried to remove the mutations and it throws same error on queries.. Its a bug? Or what I'm doing wrong?Can someone help me?
Many thanks.
Environment