Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(trusted-docs): Allows useRedwoodTrustedDocuments to set more custom UsePersistedOperationsOptions #10894

Merged
merged 8 commits into from
Jul 19, 2024

Conversation

dthyresson
Copy link
Contributor

Allows useRedwoodTrustedDocuments to set more custom UsePersistedOperationsOptions

Allows the useRedwoodTrustedDocuments plugin to define:

 /**
   * Whether to allow execution of arbitrary GraphQL operations aside from persisted operations.
   */
  allowArbitraryOperations?: boolean | AllowArbitraryOperationsHandler;
  /**
   * The path to the persisted operation id
   */
  extractPersistedOperationId?: ExtractPersistedOperationId;

  /**
   * Whether to skip validation of the persisted operation
   */
  skipDocumentValidation?: boolean;

  /**
   * Custom errors to be thrown
   */
  customErrors?: CustomPersistedQueryErrors;

This can let you override to allow certain ops or skip validation etc:

If you validate your persisted operations while building your store, we recommend to skip the validation on the server. So this will reduce the work done by the server and the latency of the requests.

The allow authenticated request is still considered, but allowArbitraryOperations can override.

Omitted getPersistedOperation as this extracts hash from store.

@dthyresson dthyresson added hacktoberfest release:feature This PR introduces a new feature labels Jun 30, 2024
@dthyresson dthyresson self-assigned this Jun 30, 2024
@dthyresson dthyresson added this to the next-release milestone Jun 30, 2024
@dthyresson dthyresson changed the title DRAFT: feat(trusted-docs): Allows useRedwoodTrustedDocuments to set more custom UsePersistedOperationsOptions feat(trusted-docs): Allows useRedwoodTrustedDocuments to set more custom UsePersistedOperationsOptions Jul 1, 2024
@dthyresson dthyresson marked this pull request as ready for review July 1, 2024 13:40
@dthyresson dthyresson requested a review from Josh-Walker-GM July 1, 2024 13:40
@Josh-Walker-GM Josh-Walker-GM merged commit 0391a30 into main Jul 19, 2024
46 checks passed
@Josh-Walker-GM Josh-Walker-GM deleted the dt-trusted-docs-extra-config branch July 19, 2024 20:08
@Josh-Walker-GM Josh-Walker-GM modified the milestones: next-release, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants