// <auto-generated/>
#nullable enable

namespace Microsoft.Extensions.DependencyInjection
{
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public static partial class NorthwindClientServiceCollectionExtensions
    {
        public static global::StrawberryShake.IClientBuilder<global::Northwind.GraphQL.Client.Console.State.NorthwindClientStoreAccessor> AddNorthwindClient(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
        {
            var serviceCollection = new global::Microsoft.Extensions.DependencyInjection.ServiceCollection();
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp =>
            {
                ConfigureClientDefault(sp, serviceCollection, strategy);
                return new ClientServiceProvider(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(serviceCollection));
            });
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::Northwind.GraphQL.Client.Console.State.NorthwindClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityIdSerializer>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp))));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Northwind.GraphQL.Client.Console.SeafoodProductsQuery>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Northwind.GraphQL.Client.Console.NorthwindClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Northwind.GraphQL.Client.Console.INorthwindClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            return new global::StrawberryShake.ClientBuilder<global::Northwind.GraphQL.Client.Console.State.NorthwindClientStoreAccessor>("NorthwindClient", services, serviceCollection);
        }

        private static global::Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureClientDefault(global::System.IServiceProvider parentServices, global::Microsoft.Extensions.DependencyInjection.ServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
        {
            global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IEntityStore, global::StrawberryShake.EntityStore>(services);
            global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IOperationStore>(services, sp => new global::StrawberryShake.OperationStore(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Transport.Http.IHttpConnection>(services, sp =>
            {
                var clientFactory = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Net.Http.IHttpClientFactory>(parentServices);
                return new global::StrawberryShake.Transport.Http.HttpConnection(() => clientFactory.CreateClient("NorthwindClient"));
            });
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.StringSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.BooleanSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ShortSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IntSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LongSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.FloatSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DecimalSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UrlSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UUIDSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IdSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteArraySerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.TimeSpanSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.JsonSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializerResolver>(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(sp))));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory<global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>, global::Northwind.GraphQL.Client.Console.State.SeafoodProductsResultFactory>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultDataFactory<global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationRequestFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>, global::Northwind.GraphQL.Client.Console.State.SeafoodProductsBuilder>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationExecutor<global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>>(services, sp => new global::StrawberryShake.OperationExecutor<global::System.Text.Json.JsonDocument, global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.Transport.Http.IHttpConnection>(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(sp), strategy));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::Northwind.GraphQL.Client.Console.SeafoodProductsQuery>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Northwind.GraphQL.Client.Console.SeafoodProductsQuery>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IEntityIdSerializer, global::Northwind.GraphQL.Client.Console.State.NorthwindClientEntityIdFactory>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::Northwind.GraphQL.Client.Console.NorthwindClient>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::Northwind.GraphQL.Client.Console.INorthwindClient>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::Northwind.GraphQL.Client.Console.NorthwindClient>(sp));
            return services;
        }

        private class ClientServiceProvider : System.IServiceProvider, System.IDisposable
        {
            private readonly System.IServiceProvider _provider;
            public ClientServiceProvider(System.IServiceProvider provider)
            {
                _provider = provider;
            }

            public object? GetService(System.Type serviceType)
            {
                return _provider.GetService(serviceType);
            }

            public void Dispose()
            {
                if (_provider is System.IDisposable d)
                {
                    d.Dispose();
                }
            }
        }
    }
}

namespace Northwind.GraphQL.Client.Console
{
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProductsResult : global::System.IEquatable<SeafoodProductsResult>, ISeafoodProductsResult
    {
        public SeafoodProductsResult(global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.ISeafoodProducts_ProductsInCategory> productsInCategory)
        {
            ProductsInCategory = productsInCategory;
        }

        public global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.ISeafoodProducts_ProductsInCategory> ProductsInCategory { get; }

        public virtual global::System.Boolean Equals(SeafoodProductsResult? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (global::StrawberryShake.Helper.ComparisonHelper.SequenceEqual(ProductsInCategory, other.ProductsInCategory));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((SeafoodProductsResult)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                foreach (var ProductsInCategory_elm in ProductsInCategory)
                {
                    hash ^= 397 * ProductsInCategory_elm.GetHashCode();
                }

                return hash;
            }
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProducts_ProductsInCategory_Product : global::System.IEquatable<SeafoodProducts_ProductsInCategory_Product>, ISeafoodProducts_ProductsInCategory_Product
    {
        public SeafoodProducts_ProductsInCategory_Product(global::System.Int32 productId, global::System.String productName, global::System.Int16? unitsInStock)
        {
            ProductId = productId;
            ProductName = productName;
            UnitsInStock = unitsInStock;
        }

        public global::System.Int32 ProductId { get; }

        public global::System.String ProductName { get; }

        public global::System.Int16? UnitsInStock { get; }

        public virtual global::System.Boolean Equals(SeafoodProducts_ProductsInCategory_Product? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (ProductId == other.ProductId) && ProductName.Equals(other.ProductName) && UnitsInStock == other.UnitsInStock;
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((SeafoodProducts_ProductsInCategory_Product)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                hash ^= 397 * ProductId.GetHashCode();
                hash ^= 397 * ProductName.GetHashCode();
                if (UnitsInStock != null)
                {
                    hash ^= 397 * UnitsInStock.GetHashCode();
                }

                return hash;
            }
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial interface ISeafoodProductsResult
    {
        public global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.ISeafoodProducts_ProductsInCategory> ProductsInCategory { get; }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial interface ISeafoodProducts_ProductsInCategory
    {
        public global::System.Int32 ProductId { get; }

        public global::System.String ProductName { get; }

        public global::System.Int16? UnitsInStock { get; }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial interface ISeafoodProducts_ProductsInCategory_Product : ISeafoodProducts_ProductsInCategory
    {
    }

    /// <summary>
    /// Represents the operation service of the SeafoodProducts GraphQL operation
    /// <code>
    /// query SeafoodProducts {
    ///   productsInCategory(categoryId: 8) {
    ///     __typename
    ///     productId
    ///     productName
    ///     unitsInStock
    ///   }
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProductsQueryDocument : global::StrawberryShake.IDocument
    {
        private SeafoodProductsQueryDocument()
        {
        }

        public static SeafoodProductsQueryDocument Instance { get; } = new SeafoodProductsQueryDocument();
        public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query;
        public global::System.ReadOnlySpan<global::System.Byte> Body => new global::System.Byte[]
        {
            0x71,
            0x75,
            0x65,
            0x72,
            0x79,
            0x20,
            0x53,
            0x65,
            0x61,
            0x66,
            0x6f,
            0x6f,
            0x64,
            0x50,
            0x72,
            0x6f,
            0x64,
            0x75,
            0x63,
            0x74,
            0x73,
            0x20,
            0x7b,
            0x20,
            0x70,
            0x72,
            0x6f,
            0x64,
            0x75,
            0x63,
            0x74,
            0x73,
            0x49,
            0x6e,
            0x43,
            0x61,
            0x74,
            0x65,
            0x67,
            0x6f,
            0x72,
            0x79,
            0x28,
            0x63,
            0x61,
            0x74,
            0x65,
            0x67,
            0x6f,
            0x72,
            0x79,
            0x49,
            0x64,
            0x3a,
            0x20,
            0x38,
            0x29,
            0x20,
            0x7b,
            0x20,
            0x5f,
            0x5f,
            0x74,
            0x79,
            0x70,
            0x65,
            0x6e,
            0x61,
            0x6d,
            0x65,
            0x20,
            0x70,
            0x72,
            0x6f,
            0x64,
            0x75,
            0x63,
            0x74,
            0x49,
            0x64,
            0x20,
            0x70,
            0x72,
            0x6f,
            0x64,
            0x75,
            0x63,
            0x74,
            0x4e,
            0x61,
            0x6d,
            0x65,
            0x20,
            0x75,
            0x6e,
            0x69,
            0x74,
            0x73,
            0x49,
            0x6e,
            0x53,
            0x74,
            0x6f,
            0x63,
            0x6b,
            0x20,
            0x7d,
            0x20,
            0x7d
        };
        public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("md5Hash", "efa84fbc8d83f6bfae13e9df8ea46b3e");
        public override global::System.String ToString()
        {
#if NETSTANDARD2_0
        return global::System.Text.Encoding.UTF8.GetString(Body.ToArray());
#else
            return global::System.Text.Encoding.UTF8.GetString(Body);
#endif
        }
    }

    /// <summary>
    /// Represents the operation service of the SeafoodProducts GraphQL operation
    /// <code>
    /// query SeafoodProducts {
    ///   productsInCategory(categoryId: 8) {
    ///     __typename
    ///     productId
    ///     productName
    ///     unitsInStock
    ///   }
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProductsQuery : global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery
    {
        private readonly global::StrawberryShake.IOperationExecutor<ISeafoodProductsResult> _operationExecutor;
        public SeafoodProductsQuery(global::StrawberryShake.IOperationExecutor<ISeafoodProductsResult> operationExecutor)
        {
            _operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor));
        }

        global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(ISeafoodProductsResult);
        public async global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<ISeafoodProductsResult>> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default)
        {
            var request = CreateRequest();
            return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
        }

        public global::System.IObservable<global::StrawberryShake.IOperationResult<ISeafoodProductsResult>> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null)
        {
            var request = CreateRequest();
            return _operationExecutor.Watch(request, strategy);
        }

        private global::StrawberryShake.OperationRequest CreateRequest()
        {
            return CreateRequest(null);
        }

        private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
        {
            return new global::StrawberryShake.OperationRequest(id: SeafoodProductsQueryDocument.Instance.Hash.Value, name: "SeafoodProducts", document: SeafoodProductsQueryDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default);
        }

        global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
        {
            return CreateRequest();
        }
    }

    /// <summary>
    /// Represents the operation service of the SeafoodProducts GraphQL operation
    /// <code>
    /// query SeafoodProducts {
    ///   productsInCategory(categoryId: 8) {
    ///     __typename
    ///     productId
    ///     productName
    ///     unitsInStock
    ///   }
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial interface ISeafoodProductsQuery : global::StrawberryShake.IOperationRequestFactory
    {
        global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<ISeafoodProductsResult>> ExecuteAsync(global::System.Threading.CancellationToken cancellationToken = default);
        global::System.IObservable<global::StrawberryShake.IOperationResult<ISeafoodProductsResult>> Watch(global::StrawberryShake.ExecutionStrategy? strategy = null);
    }

    /// <summary>
    /// Represents the NorthwindClient GraphQL client
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class NorthwindClient : global::Northwind.GraphQL.Client.Console.INorthwindClient
    {
        private readonly global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery _seafoodProducts;
        public NorthwindClient(global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery seafoodProducts)
        {
            _seafoodProducts = seafoodProducts ?? throw new global::System.ArgumentNullException(nameof(seafoodProducts));
        }

        public static global::System.String ClientName => "NorthwindClient";
        public global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery SeafoodProducts => _seafoodProducts;
    }

    /// <summary>
    /// Represents the NorthwindClient GraphQL client
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial interface INorthwindClient
    {
        global::Northwind.GraphQL.Client.Console.ISeafoodProductsQuery SeafoodProducts { get; }
    }
}

namespace Northwind.GraphQL.Client.Console.State
{
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProductsResultFactory : global::StrawberryShake.IOperationResultDataFactory<global::Northwind.GraphQL.Client.Console.SeafoodProductsResult>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        public SeafoodProductsResultFactory(global::StrawberryShake.IEntityStore entityStore)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
        }

        global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult);
        public SeafoodProductsResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
        {
            if (snapshot is null)
            {
                snapshot = _entityStore.CurrentSnapshot;
            }

            if (dataInfo is SeafoodProductsResultInfo info)
            {
                return new SeafoodProductsResult(MapNonNullableISeafoodProducts_ProductsInCategoryNonNullableArray(info.ProductsInCategory, snapshot));
            }

            throw new global::System.ArgumentException("SeafoodProductsResultInfo expected.");
        }

        private global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.ISeafoodProducts_ProductsInCategory> MapNonNullableISeafoodProducts_ProductsInCategoryNonNullableArray(global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.State.ProductData>? list, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (list is null)
            {
                throw new global::System.ArgumentNullException();
            }

            var products = new global::System.Collections.Generic.List<global::Northwind.GraphQL.Client.Console.ISeafoodProducts_ProductsInCategory>();
            foreach (global::Northwind.GraphQL.Client.Console.State.ProductData child in list)
            {
                products.Add(MapNonNullableISeafoodProducts_ProductsInCategory(child, snapshot));
            }

            return products;
        }

        private global::Northwind.GraphQL.Client.Console.ISeafoodProducts_ProductsInCategory MapNonNullableISeafoodProducts_ProductsInCategory(global::Northwind.GraphQL.Client.Console.State.ProductData data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            ISeafoodProducts_ProductsInCategory returnValue = default !;
            if (data.__typename.Equals("Product", global::System.StringComparison.Ordinal))
            {
                returnValue = new SeafoodProducts_ProductsInCategory_Product(data.ProductId ?? throw new global::System.ArgumentNullException(), data.ProductName ?? throw new global::System.ArgumentNullException(), data.UnitsInStock);
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }

        global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot)
        {
            return Create(dataInfo, snapshot);
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProductsResultInfo : global::StrawberryShake.IOperationResultDataInfo
    {
        private readonly global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> _entityIds;
        private readonly global::System.UInt64 _version;
        public SeafoodProductsResultInfo(global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.State.ProductData> productsInCategory, global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
        {
            ProductsInCategory = productsInCategory;
            _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
            _version = version;
        }

        public global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.State.ProductData> ProductsInCategory { get; }

        public global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> EntityIds => _entityIds;
        public global::System.UInt64 Version => _version;
        public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
        {
            return new SeafoodProductsResultInfo(ProductsInCategory, _entityIds, version);
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class SeafoodProductsBuilder : global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer;
        private readonly global::StrawberryShake.IOperationResultDataFactory<global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult> _resultDataFactory;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.Int32, global::System.Int32> _intParser;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::System.String> _stringParser;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.Int16, global::System.Int16> _shortParser;
        public SeafoodProductsBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory<global::Northwind.GraphQL.Client.Console.ISeafoodProductsResult> resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
            _idSerializer = idSerializer ?? throw new global::System.ArgumentNullException(nameof(idSerializer));
            _resultDataFactory = resultDataFactory ?? throw new global::System.ArgumentNullException(nameof(resultDataFactory));
            _intParser = serializerResolver.GetLeafValueParser<global::System.Int32, global::System.Int32>("Int") ?? throw new global::System.ArgumentException("No serializer for type `Int` found.");
            _stringParser = serializerResolver.GetLeafValueParser<global::System.String, global::System.String>("String") ?? throw new global::System.ArgumentException("No serializer for type `String` found.");
            _shortParser = serializerResolver.GetLeafValueParser<global::System.Int16, global::System.Int16>("Short") ?? throw new global::System.ArgumentException("No serializer for type `Short` found.");
        }

        public global::StrawberryShake.IOperationResult<ISeafoodProductsResult> Build(global::StrawberryShake.Response<global::System.Text.Json.JsonDocument> response)
        {
            (ISeafoodProductsResult Result, SeafoodProductsResultInfo Info)? data = null;
            global::System.Collections.Generic.IReadOnlyList<global::StrawberryShake.IClientError>? errors = null;
            if (response.Exception is null)
            {
                try
                {
                    if (response.Body != null)
                    {
                        if (response.Body.RootElement.TryGetProperty("data", out global::System.Text.Json.JsonElement dataElement) && dataElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
                        {
                            data = BuildData(dataElement);
                        }

                        if (response.Body.RootElement.TryGetProperty("errors", out global::System.Text.Json.JsonElement errorsElement))
                        {
                            errors = global::StrawberryShake.Json.JsonErrorParser.ParseErrors(errorsElement);
                        }
                    }
                }
                catch (global::System.Exception ex)
                {
                    errors = new global::StrawberryShake.IClientError[]
                    {
                        new global::StrawberryShake.ClientError(ex.Message, exception: ex, extensions: new global::System.Collections.Generic.Dictionary<global::System.String, global::System.Object?> { { "body", response.Body?.RootElement.ToString() } })
                    };
                }
            }
            else
            {
                if (response.Body != null && response.Body.RootElement.TryGetProperty("errors", out global::System.Text.Json.JsonElement errorsElement))
                {
                    errors = global::StrawberryShake.Json.JsonErrorParser.ParseErrors(errorsElement);
                }
                else
                {
                    errors = new global::StrawberryShake.IClientError[]
                    {
                        new global::StrawberryShake.ClientError(response.Exception.Message, exception: response.Exception, extensions: new global::System.Collections.Generic.Dictionary<global::System.String, global::System.Object?> { { "body", response.Body?.RootElement.ToString() } })
                    };
                }
            }

            return new global::StrawberryShake.OperationResult<ISeafoodProductsResult>(data?.Result, data?.Info, _resultDataFactory, errors);
        }

        private (ISeafoodProductsResult, SeafoodProductsResultInfo) BuildData(global::System.Text.Json.JsonElement obj)
        {
            var entityIds = new global::System.Collections.Generic.HashSet<global::StrawberryShake.EntityId>();
            global::StrawberryShake.IEntityStoreSnapshot snapshot = default !;
            _entityStore.Update(session =>
            {
                snapshot = session.CurrentSnapshot;
            });
            var resultInfo = new SeafoodProductsResultInfo(DeserializeNonNullableISeafoodProducts_ProductsInCategoryNonNullableArray(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "productsInCategory")), entityIds, snapshot.Version);
            return (_resultDataFactory.Create(resultInfo), resultInfo);
        }

        private global::System.Collections.Generic.IReadOnlyList<global::Northwind.GraphQL.Client.Console.State.ProductData> DeserializeNonNullableISeafoodProducts_ProductsInCategoryNonNullableArray(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            var products = new global::System.Collections.Generic.List<global::Northwind.GraphQL.Client.Console.State.ProductData>();
            foreach (global::System.Text.Json.JsonElement child in obj.Value.EnumerateArray())
            {
                products.Add(DeserializeNonNullableISeafoodProducts_ProductsInCategory(child));
            }

            return products;
        }

        private global::Northwind.GraphQL.Client.Console.State.ProductData DeserializeNonNullableISeafoodProducts_ProductsInCategory(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            var typename = obj.Value.GetProperty("__typename").GetString();
            if (typename?.Equals("Product", global::System.StringComparison.Ordinal) ?? false)
            {
                return new global::Northwind.GraphQL.Client.Console.State.ProductData(typename, productId: DeserializeNonNullableInt32(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "productId")), productName: DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "productName")), unitsInStock: DeserializeInt16(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "unitsInStock")));
            }

            throw new global::System.NotSupportedException();
        }

        private global::System.Int32 DeserializeNonNullableInt32(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            return _intParser.Parse(obj.Value.GetInt32()!);
        }

        private global::System.String DeserializeNonNullableString(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            return _stringParser.Parse(obj.Value.GetString()!);
        }

        private global::System.Int16? DeserializeInt16(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                return null;
            }

            return _shortParser.Parse(obj.Value.GetInt16()!);
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class ProductData
    {
        public ProductData(global::System.String __typename, global::System.Int32? productId = default !, global::System.String? productName = default !, global::System.Int16? unitsInStock = default !)
        {
            this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename));
            ProductId = productId;
            ProductName = productName;
            UnitsInStock = unitsInStock;
        }

        public global::System.String __typename { get; }

        public global::System.Int32? ProductId { get; }

        public global::System.String? ProductName { get; }

        public global::System.Int16? UnitsInStock { get; }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class NorthwindClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer
    {
        private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions()
        {
            Indented = false
        };
        public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj)
        {
            global::System.String __typename = obj.GetProperty("__typename").GetString()!;
            return __typename switch
            {
                _ => throw new global::System.NotSupportedException()};
        }

        public global::System.String Format(global::StrawberryShake.EntityId entityId)
        {
            return entityId.Name switch
            {
                _ => throw new global::System.NotSupportedException()};
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "12.14.0.0")]
    public partial class NorthwindClientStoreAccessor : global::StrawberryShake.StoreAccessor
    {
        public NorthwindClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories) : base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
        {
        }
    }
}
