Hello everyone,
we're currently trying to get batched queries (apollo-link-batch-http) to work with automatic persisted queries (apollo-link-persisted-queries) and apollo server 2.0 RC.
Our Apollo Client application is sending initially two batched requests:
[
{
"operationName":"LoadGeneralStatus",
"variables":{ },
"extensions":{
"persistedQuery":{
"version":1,
"sha256Hash":"b662f1ccb162a654e1f8df1cfb43828d803bec9a24507fa0ad389dbefd7a3f99"
}
}
}, {
"operationName":"LoadControlUnits",
"variables":{ },
"extensions":{
"persistedQuery":{
"version":1,
"sha256Hash":"393176e6a858d120f786901a6ab8fd4e1616165f14d176c8cb0a908a331e05fe"
}
}
}
]
The server response is as follows:
{
"errors":[
{
"message":"PersistedQueryNotFound",
"extensions":{
"code":"PERSISTED_QUERY_NOT_FOUND",
"exception":{
"stacktrace":[
"PersistedQueryNotFoundError: PersistedQueryNotFound",
" at Object.<anonymous> (C:\\Test\\Server\\node_modules\\apollo-server-core\\src\\runHttpQuery.ts:189:16)",
" at Generator.next (<anonymous>)",
" at fulfilled (C:\\Test\\Server\\node_modules\\apollo-server-core\\dist\\runHttpQuery.js:4:58)",
" at <anonymous>",
" at process._tickDomainCallback (internal/process/next_tick.js:228:7)"
]
}
}
}
]
}
Please note that there is only one response although two batched requests have been made.
Within a Query-component of React Apollo we now receive an error:
Error: server returned results with length 1, expected length of 2
at Object.next (webpack-internal:///./node_modules/apollo-link-batch/lib/batching.js:98:33)
at notifySubscription (webpack-internal:///./node_modules/zen-observable/lib/Observable.js:126:18)
at onNotify (webpack-internal:///./node_modules/zen-observable/lib/Observable.js:161:3)
at SubscriptionObserver.next (webpack-internal:///./node_modules/zen-observable/lib/Observable.js:215:7)
at eval (webpack-internal:///./node_modules/apollo-link-batch-http/lib/batchHttpLink.js:97:30)
I'm not completely certain, but I assume this is related to only receiving one response.
Expected behavior (as far as I understand it)
- Batched request with two persisted parts is beingt sent
- Server doesn't know about both and responds with two batched "PersistedQueryNotFound" messages
- Client resends the proper expanded query
- UI updates silently without any network errors
Note: this might somewhat be related to #941 ?
Hello everyone,
we're currently trying to get batched queries (apollo-link-batch-http) to work with automatic persisted queries (apollo-link-persisted-queries) and apollo server 2.0 RC.
Our Apollo Client application is sending initially two batched requests:
The server response is as follows:
Please note that there is only one response although two batched requests have been made.
Within a Query-component of React Apollo we now receive an error:
I'm not completely certain, but I assume this is related to only receiving one response.
Expected behavior (as far as I understand it)
Note: this might somewhat be related to #941 ?