graphqlhotchocolate

Using Hotchocolate Persisted Operation along with Fusion


I upgraded hotchocolate from V13 to V15 and realized that the query stitching is no longer supported and need to use Fusion package.

I am following these steps and everything is fine except that I am unable to use persisted operations with File system storage.

enter image description here

I see that it does support the Persisted Operations pipleline, but the AddFileSystemOperationDocumentStorage is not supported.

Am I missing something?


Solution

  • I ended up creating an extension method which access the base CoreBuilder to invoke AddFileSystemOperationDocumentStorage

    
    public static class FusionGatewayBuilderExtensions
    {
        public static FusionGatewayBuilder AddFileSystemOperationDocumentStorage(
            this FusionGatewayBuilder builder, string path)
        {
            ArgumentNullException.ThrowIfNull(builder);
    
            builder.CoreBuilder.AddFileSystemOperationDocumentStorage(path);
            return builder;
        }
    }