public static IRequestExecutorBuilder AddPagingForPreProcessedResults(
            this IRequestExecutorBuilder builder
            )
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            //Updated for v12 to now use the Extension Helpers provided to correctly initialize the Paging Providers for Pre Processed Results...
            builder
            .AddCursorPagingProvider <PreProcessedCursorPagingProvider>()
            .AddOffsetPagingProvider <PreProcessedOffsetPagingProvider>();

            return(builder);
        }
Beispiel #2
0
        /// <summary>
        /// Adds the MongoDB cursor and offset paging providers.
        /// </summary>
        /// <param name="builder">
        /// The GraphQL configuration builder.
        /// </param>
        /// <param name="providerName">
        /// The name which shall be used to refer to this registration.
        /// </param>
        /// <param name="defaultProvider">
        /// Defines if these providers shall be registered as default providers.
        /// </param>
        /// <returns>
        /// Returns the GraphQL configuration builder for further configuration chaining.
        /// </returns>
        public static IRequestExecutorBuilder AddMongoDbPagingProviders(
            this IRequestExecutorBuilder builder,
            string?providerName  = null,
            bool defaultProvider = false)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.AddCursorPagingProvider <MongoDbCursorPagingProvider>(
                providerName,
                defaultProvider);

            builder.AddOffsetPagingProvider <MongoDbOffsetPagingProvider>(
                providerName,
                defaultProvider);

            return(builder);
        }