We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
Type-graphql is a amazing library for sure
I currently got an issue with extending Return model class in Resolver
For example:
Model:
@ObjectType({ description: "User Type" }) export class SubUser { @Field() firstName: string; } @ObjectType({ description: "User Type" }) export class User extends SubUser { @Field() id: string; @Field() lastName: string; }
Query:
query getUser{ getUser{ firstName, lastName } }
Resolver:
@Authorized() @Query(returns => User, { nullable: true }) async getUser() { return await getUser(); }
Error:
"stacktrace": [ "Expected value of type \"User\" but got: { email: \"aaa@aaa.com\", id: \"UFZngG0M0lWbE5VtO2unWs9rUne2\", role: \"Student\", signInMethod: \"UserNameAndPassword\", lastName: \"asdasdasda\", phone: \"0451111111\", firstName: \"asdasdas\" }.", "", "GraphQL request (2:3)", "1: query getUser {", "2: getUser {", " ^", "3: firstName", "", " at invalidReturnTypeError (C:\\Projects\\eTutors-Backend\\node_modules\\graphql\\execution\\execute.js:711:10)", " at completeObjectValue (C:\\Projects\\eTutors-Backend\\node_modules\\graphql\\execution\\execute.js:703:13)", " at completeValue (C:\\Projects\\eTutors-Backend\\node_modules\\graphql\\execution\\execute.js:598:12)", " at C:\\Projects\\eTutors-Backend\\node_modules\\graphql\\execution\\execute.js:500:16", " at process._tickCallback (internal/process/next_tick.js:68:7)" ]
Is it a bug or I was doing wrong thing?
Thanks CJ
The text was updated successfully, but these errors were encountered:
#160
Sorry, something went wrong.
No branches or pull requests
Hi,
Type-graphql is a amazing library for sure
I currently got an issue with extending Return model class in Resolver
For example:
Model:
Query:
Resolver:
Error:
Is it a bug or I was doing wrong thing?
Thanks
CJ
The text was updated successfully, but these errors were encountered: