Skip to content

apollo-server-core 2.9.14 breaks APQ usage #3627

@tapsboy

Description

@tapsboy

My GraphQL App server depends on apollo-server-express which I recently updated to 2.9.14 (which in turn resolves apollo-server-core 2.9.14). Upon updating to this version, my APQ queries started failing, with an internal error 500 as the response:

{
	"errors": [{
		"message": "[internal apollo-server error] addProtobufError called before startTiming!",
		"extensions": {
			"code": "INTERNAL_SERVER_ERROR",
			"exception": {
				"stacktrace": ["Error: 
[internal apollo-server error] addProtobufError called before startTiming!", "    
at internalError (/path-to-dir/node_modules/apollo-engine-reporting/dist/treeBuilder.js:6:12)", "    
at EngineReportingTreeBuilder.addProtobufError (/path-to-dir/node_modules/apollo-engine-reporting/dist/treeBuilder.js:72:19)", "    
at /path-to-dir/node_modules/apollo-engine-reporting/dist/treeBuilder.js:67:18", "    
at Array.forEach (<anonymous>)", "    
at EngineReportingTreeBuilder.didEncounterErrors (/path-to-dir/node_modules/apollo-engine-reporting/dist/treeBuilder.js:59:16)", "    
at EngineReportingExtension.didEncounterErrors (/path-to-dir/node_modules/apollo-engine-reporting/dist/extension.js:84:26)", "    
at /path-to-dir/node_modules/graphql-extensions/dist/index.js:29:27", "    
at Array.forEach (<anonymous>)", "    
at GraphQLExtensionStack.didEncounterErrors (/path-to-dir/node_modules/graphql-extensions/dist/index.js:27:25)", "    
at /path-to-dir/node_modules/apollo-server-core/dist/requestPipeline.js:268:32"
]
			}
		}
	}]
}

My expected response was:

{
	"errors": [{
		"message": "PersistedQueryNotFound",
		"extensions": {
			"code": "PERSISTED_QUERY_NOT_FOUND",
			"exception": {
				"stacktrace": [
"PersistedQueryNotFoundError: PersistedQueryNotFound", "    
at Object.<anonymous> (/path-to-dir/node_modules/apollo-server-core/dist/requestPipeline.js:75:52)", "    
at Generator.next (<anonymous>)", "    
at fulfilled (/path-to-dir/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)", "    
at <anonymous>", "   
at process._tickCallback (internal/process/next_tick.js:189:7)"]
			}
		}
	}]
}

Upon further reading of code, I found this PR that changes the server-core and might be influencing the behavior: dcbbc34

I am not sure if I am doing something wrong on the Apollo Client side, but

A prior release tag of app included 2.9.13 for both apollo-server-express and apollo-server-core works fine. My temp fix involved was to get that package-lock from that tag to ensure that it worked.

Note: Manually edited the error responses for easy reading and to redact private path structures

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions