public static void RegisterDataLoader( this ISchemaConfiguration configuration, Type type) { throw new NotSupportedException( "This method is no longer supported."); }
public static Schema GetSchema(this ISchemaConfiguration schemaConfiguration, ICustomPropertyConfigurationProvider customPropertyConfigurationProvider) { var description = schemaConfiguration.Description; if (description.CountLimit == 0) { description.CountLimit = 1000; } if (description.CountLimitForSuperUser == 0) { description.CountLimitForSuperUser = description.CountLimit; } if (description.DownloadLimit == 0) { description.DownloadLimit = 10000; } if (description.DownloadLimitForSuperUser == 0) { description.DownloadLimitForSuperUser = description.DownloadLimit; } return(new Schema { Description = description, Types = schemaConfiguration.Types, ConnectorsFactory = schemaConfiguration.ConnectorsFactory, CustomPropertyConfigurationProvider = customPropertyConfigurationProvider, PropertyDescriptionBuilder = schemaConfiguration.PropertyDescriptionBuilder, }); }
/// <summary> /// Merges the specified schema configuration into this configuration as allowed by this instance. /// </summary> /// <param name="schemaConfig">The schema configuration.</param> public void Merge(ISchemaConfiguration schemaConfig) { _declarationOptions.Merge(schemaConfig.DeclarationOptions); _executionOptions.Merge(schemaConfig.ExecutionOptions); _responseOptions.Merge(schemaConfig.ResponseOptions); _cacheOptions.Merge(schemaConfig.QueryCacheOptions); }
public static ISchemaConfiguration Use <TMiddleware>( this ISchemaConfiguration configuration) where TMiddleware : class { return(configuration.Use( FieldClassMiddlewareFactory.Create <TMiddleware>())); }
public SqlReflection(OracleConnectionProvider provider, ISchemaConfiguration schemaConfiguration) { _provider = provider; _schema = schemaConfiguration.Schema; _buildData = new Task(BuildData); _buildData.Start(); }
public static void RegisterDataLoader <TLoader>( this ISchemaConfiguration configuration) where TLoader : class, IDispatchableDataLoader { RegisterDataLoader <TLoader>(configuration, typeof(TLoader).FullName, ExecutionScope.Request); }
public static void RegisterDataLoader( this ISchemaConfiguration configuration, Type type) { RegisterDataLoader(configuration, type, type.FullName, ExecutionScope.Request); }
public static void RegisterDataLoader <TLoader>( this ISchemaConfiguration configuration) where TLoader : class, IDataLoader { throw new NotSupportedException( "This method is no longer supported."); }
public static void RegisterDirective( this ISchemaConfiguration context, string name, DirectiveLocation location, Func <IDirectiveTypeDescriptor, IDirectiveTypeDescriptor> configure) => context.RegisterDirective(new DirectiveType(x => configure(x.Name(name).Location(location))));
public static void RegisterDataLoader <TLoader>( this ISchemaConfiguration configuration, Func <IServiceProvider, TLoader> loaderFactory) where TLoader : IDataLoader { throw new NotSupportedException( "This method is no longer supported."); }
public static ISchemaConfiguration Use <TMiddleware>( this ISchemaConfiguration configuration, Func <IServiceProvider, FieldDelegate, TMiddleware> factory) where TMiddleware : class { return(configuration.Use( FieldClassMiddlewareFactory.Create(factory))); }
public static void RegisterDataLoader( this ISchemaConfiguration configuration, Type type, ExecutionScope scope, Func <IServiceProvider, IDataLoader> loaderFactory) { throw new NotSupportedException( "This method is no longer supported."); }
public static void RegisterDataLoader( this ISchemaConfiguration configuration, Type type, Func <IServiceProvider, IDispatchableDataLoader> loaderFactory) { RegisterDataLoader(configuration, type, type.FullName, ExecutionScope.Request, loaderFactory); }
public static void RegisterDataLoader <TLoader>( this ISchemaConfiguration configuration, string key, ExecutionScope scope) where TLoader : class, IDispatchableDataLoader { configuration.RegisterDataLoader <TLoader>(key, scope, triggerLoaderAsync: (d, c) => d.DispatchAsync()); }
public static void RegisterDataLoader <TLoader>( this ISchemaConfiguration configuration, Func <IServiceProvider, TLoader> loaderFactory) where TLoader : IDispatchableDataLoader { RegisterDataLoader <TLoader>( configuration, typeof(TLoader).FullName, ExecutionScope.Request, loaderFactory); }
public static void RegisterDataLoader <TLoader>( this ISchemaConfiguration configuration, string key, ExecutionScope scope, Func <IServiceProvider, TLoader> loaderFactory) where TLoader : IDispatchableDataLoader { configuration.RegisterDataLoader <TLoader>( key, scope, loaderFactory, (d, c) => d.DispatchAsync()); }
public static ISchemaConfiguration Map( this ISchemaConfiguration configuration, FieldReference fieldReference, FieldMiddleware middleware) { return(configuration.Use( FieldClassMiddlewareFactory.Create( (s, n) => new MapMiddleware( n, fieldReference, middleware(n))))); }
public static ISchemaConfiguration UseGlobalObjectIdentifier( this ISchemaConfiguration configuration) { if (configuration is null) { throw new ArgumentNullException(nameof(configuration)); } return(configuration.Use <IdMiddleware>()); }
public static IBindType <T> BindType <T>( this ISchemaConfiguration schemaConfiguration) where T : class { if (schemaConfiguration == null) { throw new ArgumentNullException(nameof(schemaConfiguration)); } return(schemaConfiguration.BindType <T>(BindingBehavior.Implicit)); }
public static void RegisterDataLoader( this ISchemaConfiguration configuration, Type type, string key, ExecutionScope scope) { configuration.RegisterDataLoader(type, key, scope, triggerLoaderAsync: (d, c) => ((IDispatchableDataLoader)d) .DispatchAsync()); }
public static void RegisterDataLoader( this ISchemaConfiguration configuration, Type type, string key, ExecutionScope scope, Func <IServiceProvider, IDispatchableDataLoader> loaderFactory) { configuration.RegisterDataLoader(type, key, scope, loaderFactory, (d, c) => ((IDispatchableDataLoader)d).DispatchAsync()); }
public static IBindResolverDelegate BindResolver( this ISchemaConfiguration schemaConfiguration, Func <Task <object> > resolver) { if (resolver == null) { throw new ArgumentNullException(nameof(resolver)); } return(schemaConfiguration.BindResolver((ctx, ct) => resolver())); }
public static void ConfigureSchema(ISchemaConfiguration configuration) { if (configuration == null) { throw new System.ArgumentNullException(nameof(configuration)); } configuration.RegisterQueryType <QueryType>(); configuration.RegisterMutationType <MutationType>(); configuration.UseGlobalObjectIdentifier(); }
public static void RegisterTypeByInterface<T>(this ISchemaConfiguration c, Assembly[] assemblies, ServiceLifetime lifetime = ServiceLifetime.Transient) { var typesFromAssemblies = assemblies.SelectMany(a => a.DefinedTypes.Where(x => x.GetInterfaces().Contains(typeof(T)))); foreach (var type in typesFromAssemblies) { var registerTypeInfo = typeof(ICodeFirstConfiguration).GetMethods() .First(m => m.IsGenericMethod && m.Name == "RegisterType"); registerTypeInfo.MakeGenericMethod(type.AsType()).Invoke(c, new object[]{}); } }
public static ISchemaConfiguration UseNullResolver( this ISchemaConfiguration configuration) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } configuration.Use(next => context => Task.CompletedTask); return(configuration); }
public static IBindResolver <TResolver> BindResolver <TResolver>( this ISchemaConfiguration schemaConfiguration) where TResolver : class { if (schemaConfiguration is null) { throw new ArgumentNullException(nameof(schemaConfiguration)); } return(schemaConfiguration.BindResolver <TResolver>( BindingBehavior.Implicit)); }
public static IBindResolverDelegate BindResolver( this ISchemaConfiguration schemaConfiguration, Func <IResolverContext, object> resolver) { if (schemaConfiguration == null) { throw new ArgumentNullException(nameof(schemaConfiguration)); } return(schemaConfiguration.BindResolver( ctx => Task.FromResult(resolver(ctx)))); }
private void ConfigureSchema(ISchemaConfiguration schema) { if (_environment.IsDevelopment()) { schema.Options.StrictValidation = false; } schema.BindType <CreditCard>(); schema.BindResolver <QueryResolver>() .To("Query") .Resolve("cards") .With(t => t.GetAllCardsAsync(default))
public static ISchemaConfiguration RegisterObjectTypes(this ISchemaConfiguration schemaConfiguration, Assembly graphTypeAssembly) { var objectTypes = graphTypeAssembly .GetTypes() .Where(type => typeof(ObjectType).IsAssignableFrom(type)); foreach (var objectType in objectTypes) { schemaConfiguration.RegisterType(objectType); } return(schemaConfiguration); }
public static void ConfigureSchema(ISchemaConfiguration configuration) { if (configuration == null) { throw new System.ArgumentNullException(nameof(configuration)); } configuration.RegisterQueryType <QueryType>(); configuration.RegisterType <LifeInsuranceContractType>(); configuration.RegisterType <SomeOtherContractType>(); configuration.RegisterDirective <CustomDirectiveType>(); configuration.UseGlobalObjectIdentifier(); }
public SqlDBProvider(ISchemaConfiguration SchemaConfiguration) { this._db = new SqlConnection(SchemaConfiguration.GetConnectionString()); }
public OmletSchemaProvider(IRootPathProvider rootProvider, ISchemaConfiguration configuration) { this.rootProvider = rootProvider; this.configuration = configuration; this.cache = new OmletSchemaCache(ResolveSchema); }