You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started a new project, when I added graphql it installed version ^16.0.1.
In my project I have a mongoose.Schema that validates an email string, the validation itself works, but when the mutation is given an invalid entry rather than returning the validation error message, I'm getting the following error:
{
"errors": [
{
"message": "Support for returning GraphQLObjectType from resolveType was removed in [email protected] please return type name instead.",
"locations": [
{
"line": 7,
"column": 5
}
],
"path": [
"userCreateOne",
"error"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"message": "Support for returning GraphQLObjectType from resolveType was removed in [email protected] please return type name instead.",
"stacktrace": [
"GraphQLError: Support for returning GraphQLObjectType from resolveType was removed in [email protected] please return type name instead.",
" at ensureValidRuntimeType (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:816:11)",
" at completeAbstractValue (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:784:5)",
" at completeValue (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:612:12)",
" at executeField (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:477:19)",
" at executeFields (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:401:20)",
" at completeObjectValue (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:895:10)",
" at completeValue (./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:624:12)",
" at ./node_modules/.pnpm/[email protected]/node_modules/graphql/execution/execute.js:474:9",
" at processTicksAndRejections (internal/process/task_queues.js:95:5)",
" at execute (./node_modules/.pnpm/[email protected][email protected]/node_modules/apollo-server-core/src/requestPipeline.ts:485:14)"
]
}
}
}
],
"data": {
"userCreateOne": {
"recordId": null,
"record": null,
"error": null
}
}
}
If I downgrade graphql to ^15.5.0, then I get a proper validation error message:
I have started a new project, when I added
graphql
it installed version^16.0.1
.In my project I have a
mongoose.Schema
that validates an email string, the validation itself works, but when the mutation is given an invalid entry rather than returning the validation error message, I'm getting the following error:If I downgrade
graphql
to^15.5.0
, then I get a proper validation error message:I am guessing that the composed resolver returns a
GraphQLObjectType
as theresolveType
when an error occurs, and as the error points out:Support for returning GraphQLObjectType from resolveType was removed in [email protected] please return type name instead.
The text was updated successfully, but these errors were encountered: