apollo-link-persisted-queries icon indicating copy to clipboard operation
apollo-link-persisted-queries copied to clipboard

PersistedQueryNotSupported errors will stop all other extensions

Open paulpdaniels opened this issue 6 years ago • 0 comments
trafficstars

The persisted-queries link seems to be affecting sending of other extensions.

Particularly this line. If the server has responded that PQs are not supported the link is setting the includeExtensions in http context to false which means that all extensions are no longer sent. This causes an issue with the new clientInfo extension from apollo-server. The work around is to use headers to send it and write a custom extractor on the server side, but ideally AL-PQs should be a good Link citizen and not stop other extensions.

My suggestion is perhaps instead of killing extensions the API should just strip the extension from the operation before sending or possibly there could be an API change to the includeExtensions field such that it could take either a boolean or an array of strings or an object of string -> boolean key/values, where the latter type we you can simply do:

includeExtensions: {persistedQueries: false}

paulpdaniels avatar Dec 05 '18 03:12 paulpdaniels