Exemplo n.º 1
0
        public static ISchemaBuilder BindClrType <TClrType, TSchemaType>(
            this ISchemaBuilder builder)
            where TSchemaType : INamedType
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.BindClrType(typeof(TClrType), typeof(TSchemaType)));
        }
Exemplo n.º 2
0
        public static ISchemaBuilder AddOurCommonGraphQLTypes(this ISchemaBuilder schemaBuilder)
        {
            // Ensure string still defaults to StringType
            schemaBuilder.BindClrType <string, StringType>();

            // Set a maximum page size
            schemaBuilder
            .AddType(new PaginationAmountType(50))
            .BindClrType <int, IntType>();

            return(schemaBuilder);
        }