Apollo error sending two error object for each error

Hi @MichelleMabuyo I just cloned project voyage odyssey 1 series, code from below mentioned git url -

Please refere below snapshot - I am using locations subgraph and passing below query and null as localtionId

query Locations($locationId: ID!) {
location(id: $locationId) {
id
name
}
}

image

But, there is a issue with error section in repsosne -
I am getting two error object for similar type of error , refer below blockquote for complete error object-
For each type of error, error object contains duplicate object for same

Blockquote
{
“data”: {},
“errors”: [
{
“message”: “Variable "$locationId" of non-null type "ID!" must not be null.”,
“locations”: [
{
“line”: 1,
“column”: 17
}
],
“extensions”: {
“code”: “BAD_USER_INPUT”,
“stacktrace”: [
“GraphQLError: Variable "$locationId" of non-null type "ID!" must not be null.”,
" at coerceVariableValues (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\values.js:122:9)“,
" at getVariableValues (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\values.js:45:21)”,
" at buildExecutionContext (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\execute.js:280:63)“,
" at execute (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\execute.js:116:22)”,
" at executeIncrementally (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\incrementalDeliveryPolyfill.js:47:34)“,
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at async execute (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\requestPipeline.js:223:37)“,
" at async processGraphQLRequest (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\requestPipeline.js:158:32)”,
" at async internalExecuteOperation (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\ApolloServer.js:603:16)“,
" at async runHttpQuery (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\runHttpQuery.js:121:29)”
]
}
},
{
“message”: “Variable "$locationId" of non-null type "ID!" must not be null.”,
“locations”: [
{
“line”: 1,
“column”: 17
}
],
“extensions”: {
“code”: “BAD_USER_INPUT”,
“stacktrace”: [
“GraphQLError: Variable "$locationId" of non-null type "ID!" must not be null.”,
" at coerceVariableValues (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\values.js:122:9)“,
" at getVariableValues (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\values.js:45:21)”,
" at buildExecutionContext (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\execute.js:280:63)“,
" at execute (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\graphql\execution\execute.js:116:22)”,
" at executeIncrementally (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\incrementalDeliveryPolyfill.js:47:34)“,
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at async execute (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\requestPipeline.js:223:37)“,
" at async processGraphQLRequest (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\requestPipeline.js:158:32)”,
" at async internalExecuteOperation (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\ApolloServer.js:603:16)“,
" at async runHttpQuery (C:\Users\ankitsingh57\Documents\Humana\apollo_voyage_poroject\odyssey-voyage-I\subgraph-locations\node_modules\@apollo\server\dist\cjs\runHttpQuery.js:121:29)”
]
}
}
]
}

@MichelleMabuyo Gentle reminder regarding the same, I am getting duplicate errors i.e. two error object per error, so program has 2 errors, getting 4 objects in errors. Please see
Getting in subgraph locations project

Hey @ankit9787 ! I’m getting the same duplicate error and I’m looking into it. Thanks for letting us know!

Reporting back @ankit9787 ! The team has fixed the issue, so you should no longer be seeing duplicate error messages :tada:

You’ll need to update Sandbox first. Click on the megaphone icon beside your profile photo on the top right.

Screenshot 2023-05-17 at 1.10.59 PM

Then click the button “Update available, click to relaunch”.

Hope that works on your end, let me know if I can help any further! Thanks again for reporting this!

1 Like