mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 09:41:40 -05:00
chore: Simplify logic for caching persisted query asynchronously.
This method is so large this was just low-hanging fruit along a path of potential opportunities.
This commit is contained in:
parent
6b47f6f3e6
commit
89d20b39db
1 changed files with 3 additions and 9 deletions
|
@ -135,15 +135,9 @@ export async function processGraphQLRequest<TContext>(
|
|||
|
||||
persistedQueryRegister = true;
|
||||
|
||||
// Store the query asynchronously so we don't block.
|
||||
(async () => {
|
||||
return (
|
||||
config.persistedQueries &&
|
||||
config.persistedQueries.cache.set(`apq:${queryHash}`, query)
|
||||
);
|
||||
})().catch(error => {
|
||||
console.warn(error);
|
||||
});
|
||||
Promise.resolve(
|
||||
config.persistedQueries.cache.set(`apq:${queryHash}`, query),
|
||||
).catch(console.warn);
|
||||
}
|
||||
} else if (query) {
|
||||
// FIXME: We'll compute the APQ query hash to use as our cache key for
|
||||
|
|
Loading…
Add table
Reference in a new issue