close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2307

Table Of Contents

9. Persisted Queries

Persisted Queries allow clients to issue GraphQL queries without transferring the whole (potentially long) query string at each request. Instead, clients pass a short ID or hash of the query string. The actual query string is stored on the server side, either by loading it at server startup, or by a client upload as part of an Automatic Persisted Query.

Persisted Queries have the following advantages:

  • Reduced bandwidth

    The payload of the request is generally reduced.

  • Better CDN cacheability

    Clients can use HTTP GET requests even for large queries.

  • Reduced latency

    Using HTTP GET makes it easy to avoid CORS preflight requests issued by a browser client (HTTP OPTIONS requests).

  • Query whitelisting

    Client queries may be restricted to the queries already known to the server, blocking potentially malicious queries.

Several GraphQL client frameworks support persisted queries, including Apollo Client and Relay. The CoreMedia Headless Server allows you to leverage this advanced GraphQL feature.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.