-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow persisting to also include the query text for safe migration (#…
…3917) Summary: Hi folks. We're attempting to start using persisted queries. However, we're not 100% confident in our ability to switch over to them in one big step safely. Fetching the persisted documents is a new capability for our GraphQL server. If something goes wrong fetching the document, or if it introduces unexpected latency to our existing production queries we want to be able to fallback to the query text until we're more confident in its maturity. Relay currently supports outputting the query text, or outputting the persisted document id. This PR introduces a middle state, where the text and id are both output. When both are sent with the GraphQL request from the client to the server, the server is able to control the rollout of persisted queries via a feature flag. This PR introduces a `safeMigration` bool to the remote persist config, which when set will also output the query text in the operation params as well as the id ```js persistConfig: { url: ..., params: ..., includeQueryText: true } ``` The benefits of persisted queries (saving the network bytes) won't come until we've progressed past the migration stage, but it makes it possible to do the move in the first place. Pull Request resolved: #3917 Reviewed By: tyao1 Differential Revision: D46075478 Pulled By: captbaritone fbshipit-source-id: 528ce0cec6fcee50ea80f416edb2e4568c487b77
- Loading branch information
1 parent
c530888
commit 95c54b4
Showing
4 changed files
with
68 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters