⚡️ Pro Feature ⚡️ This feature is bundled with GraphQL-Pro.

Client Workflow

To use persisted queries with your client application, you must:

This documentation also touches on graphql-ruby-client, a JavaScript client library for using OperationStore.

Add a Client

Clients are registered via the dashboard:

Add a Client for Persisted Queries

A default secret is provided for you, but you can also enter your own. The secret is used for HMAC authentication.

(Are you interested in a Ruby API for this? Please open an issue or email support@graphql.pro.)

Syncing

Once a client is registered, it can push queries to the server via the Sync API.

The easiest way to sync is with graphql-ruby-client sync, a command-line tool written in JavaScript: graphql-ruby-client.

In short, it:

For example:

OperationStore client sync

See the readme for Relay support, Apollo Client support, and plain JS usage.

For help syncing in another language, you can take inspiration from the JavaScript implementation, open an issue , or email support@graphql.pro.

Client Usage

graphql-ruby-client generates Apollo middleware and a Relay helper function to get started quickly.

To run stored operations from another client, send a param called operationId which is composed of:

 {
   # ...
   operationId: "my-relay-app/ce79aa2784fc..."
   #            ^ client id  / ^ operation id
 }

The server will use those values to fetch an operation from the database.

Next Steps

Learn more about OperationStore’s authentication or read some tips for server management.