Skip to content

doesn't work with apollo's automatic persisted queries(APQ) #6

@chirag04

Description

@chirag04

https://www.apollographql.com/docs/apollo-server/performance/apq/

APQ relies on extensions in the query body(POST) or query(GET) to enabled persisted queries. After some digging I realized: we use express-graphql to parse the request https://github.com/ef-eng/express-graphql-query-rewriter/blob/master/src/index.ts#L69. which swallows the extensions key in the request body.

consumers could parse the body before express-graphql-query-rewriter gets it bu the downside of this is:

  1. Query stored in APQ cache will be the rewritten one and not what the consumer actually passed.
  2. Adding or modifying a rewriter won't have any impact because the query will be cached already in the APQ cache.

I'm wondering if we can leverage apollo's request pipeline for this: https://www.apollographql.com/docs/apollo-server/integrations/plugins/#apollo-server-event-reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions