diff --git a/website/src/docs/hotchocolate/v14/migrating/migrate-from-13-to-14.md b/website/src/docs/hotchocolate/v14/migrating/migrate-from-13-to-14.md index d38907a560b..4d5c6ec74ed 100644 --- a/website/src/docs/hotchocolate/v14/migrating/migrate-from-13-to-14.md +++ b/website/src/docs/hotchocolate/v14/migrating/migrate-from-13-to-14.md @@ -189,19 +189,24 @@ Please ensure that your clients are sending date/time strings in the correct for ### Methods renamed -| Old method name | New method name | -| ----------------------------------- | -------------------------------------- | -| UsePersistedQueryPipeline | UsePersistedOperationPipeline | -| UseAutomaticPersistedQueryPipeline | UseAutomaticPersistedOperationPipeline | -| AddFileSystemQueryStorage | AddFileSystemOperationDocumentStorage | -| AddInMemoryQueryStorage | AddInMemoryOperationDocumentStorage | -| AddRedisQueryStorage | AddRedisOperationDocumentStorage | -| OnlyAllowPersistedQueries | OnlyAllowPersistedOperations | -| OnlyPersistedQueriesAreAllowedError | OnlyPersistedOperationsAreAllowedError | -| AllowNonPersistedQuery | AllowNonPersistedOperation | -| UseReadPersistedQuery | UseReadPersistedOperation | -| UseAutomaticPersistedQueryNotFound | UseAutomaticPersistedOperationNotFound | -| UseWritePersistedQuery | UseWritePersistedOperation | +| Old method name | New method name | +| ---------------------------------- | -------------------------------------- | +| UsePersistedQueryPipeline | UsePersistedOperationPipeline | +| UseAutomaticPersistedQueryPipeline | UseAutomaticPersistedOperationPipeline | +| AddFileSystemQueryStorage | AddFileSystemOperationDocumentStorage | +| AddInMemoryQueryStorage | AddInMemoryOperationDocumentStorage | +| AddRedisQueryStorage | AddRedisOperationDocumentStorage | +| AllowNonPersistedQuery | AllowNonPersistedOperation | +| UseReadPersistedQuery | UseReadPersistedOperation | +| UseAutomaticPersistedQueryNotFound | UseAutomaticPersistedOperationNotFound | +| UseWritePersistedQuery | UseWritePersistedOperation | + +### Options renamed + +| Old option name | New option name | +| ----------------------------------- | ----------------------------------------------- | +| OnlyAllowPersistedQueries | PersistedOperations.OnlyAllowPersistedDocuments | +| OnlyPersistedQueriesAreAllowedError | PersistedOperations.OperationNotAllowedError | ### Defaults changed @@ -233,20 +238,6 @@ Accessing a keyed service that has not been registered will now throw, instead o This change aligns the API with the regular (non-keyed) service access API. -## Change to OnlyAllowPersistedOperations option - -**Before** - -```csharp -ModifyRequestOptions(o => o.OnlyAllowPersistedOperations = true); -``` - -**After** - -```csharp -ModifyRequestOptions(o => o.PersistedOperations.OnlyAllowPersistedDocuments = true); -``` - # Deprecations Things that will continue to function this release, but we encourage you to move away from. diff --git a/website/src/docs/hotchocolate/v15/migrating/migrate-from-13-to-14.md b/website/src/docs/hotchocolate/v15/migrating/migrate-from-13-to-14.md index d38907a560b..4d5c6ec74ed 100644 --- a/website/src/docs/hotchocolate/v15/migrating/migrate-from-13-to-14.md +++ b/website/src/docs/hotchocolate/v15/migrating/migrate-from-13-to-14.md @@ -189,19 +189,24 @@ Please ensure that your clients are sending date/time strings in the correct for ### Methods renamed -| Old method name | New method name | -| ----------------------------------- | -------------------------------------- | -| UsePersistedQueryPipeline | UsePersistedOperationPipeline | -| UseAutomaticPersistedQueryPipeline | UseAutomaticPersistedOperationPipeline | -| AddFileSystemQueryStorage | AddFileSystemOperationDocumentStorage | -| AddInMemoryQueryStorage | AddInMemoryOperationDocumentStorage | -| AddRedisQueryStorage | AddRedisOperationDocumentStorage | -| OnlyAllowPersistedQueries | OnlyAllowPersistedOperations | -| OnlyPersistedQueriesAreAllowedError | OnlyPersistedOperationsAreAllowedError | -| AllowNonPersistedQuery | AllowNonPersistedOperation | -| UseReadPersistedQuery | UseReadPersistedOperation | -| UseAutomaticPersistedQueryNotFound | UseAutomaticPersistedOperationNotFound | -| UseWritePersistedQuery | UseWritePersistedOperation | +| Old method name | New method name | +| ---------------------------------- | -------------------------------------- | +| UsePersistedQueryPipeline | UsePersistedOperationPipeline | +| UseAutomaticPersistedQueryPipeline | UseAutomaticPersistedOperationPipeline | +| AddFileSystemQueryStorage | AddFileSystemOperationDocumentStorage | +| AddInMemoryQueryStorage | AddInMemoryOperationDocumentStorage | +| AddRedisQueryStorage | AddRedisOperationDocumentStorage | +| AllowNonPersistedQuery | AllowNonPersistedOperation | +| UseReadPersistedQuery | UseReadPersistedOperation | +| UseAutomaticPersistedQueryNotFound | UseAutomaticPersistedOperationNotFound | +| UseWritePersistedQuery | UseWritePersistedOperation | + +### Options renamed + +| Old option name | New option name | +| ----------------------------------- | ----------------------------------------------- | +| OnlyAllowPersistedQueries | PersistedOperations.OnlyAllowPersistedDocuments | +| OnlyPersistedQueriesAreAllowedError | PersistedOperations.OperationNotAllowedError | ### Defaults changed @@ -233,20 +238,6 @@ Accessing a keyed service that has not been registered will now throw, instead o This change aligns the API with the regular (non-keyed) service access API. -## Change to OnlyAllowPersistedOperations option - -**Before** - -```csharp -ModifyRequestOptions(o => o.OnlyAllowPersistedOperations = true); -``` - -**After** - -```csharp -ModifyRequestOptions(o => o.PersistedOperations.OnlyAllowPersistedDocuments = true); -``` - # Deprecations Things that will continue to function this release, but we encourage you to move away from. diff --git a/website/src/docs/nitro/apis/client-registry.md b/website/src/docs/nitro/apis/client-registry.md index a07607d3d19..67259381039 100644 --- a/website/src/docs/nitro/apis/client-registry.md +++ b/website/src/docs/nitro/apis/client-registry.md @@ -126,7 +126,7 @@ public void ConfigureServices(IServiceCollection services) ## Block Ad-Hoc Queries While you want to allow ad-hoc queries during development, you might want to disable them in production. -This can be done by setting the `OnlyAllowPersistedOperations` option to `true` in the `ModifyRequestOptions` method. +This can be done by setting the `PersistedOperations.OnlyAllowPersistedDocuments` option to `true` in the `ModifyRequestOptions` method. ```csharp public void ConfigureServices(IServiceCollection services) @@ -135,7 +135,7 @@ public void ConfigureServices(IServiceCollection services) .AddGraphQLServer() .AddQueryType() .AddNitro() // Connect to the client registry - .ModifyRequestOptions(x => x.OnlyAllowPersistedOperations = true) + .ModifyRequestOptions(x => x.PersistedOperations.OnlyAllowPersistedDocuments = true) .UsePersistedOperationPipeline(); // Enable the persisted operation pipeline } ``` @@ -151,8 +151,8 @@ public void ConfigureServices(IServiceCollection services) .AddNitro() // Connect to the client registry .ModifyRequestOptions(x => { - x.OnlyAllowPersistedOperations = true; - x.OnlyPersistedOperationsAreAllowedError = ErrorBuilder.New() + x.PersistedOperations.OnlyAllowPersistedDocuments = true; + x.PersistedOperations.OperationNotAllowedError = ErrorBuilder.New() .SetMessage("Only persisted operations are allowed.") .Build(); })