public void RegisterMiddleware(IDirectiveMiddleware middleware) { if (middleware == null) { throw new ArgumentNullException(nameof(middleware)); } _middlewares[middleware.DirectiveName] = middleware; }
public void RegisterMiddleware(IDirectiveMiddleware middleware) { if (middleware == null) { throw new ArgumentNullException(nameof(middleware)); } _schemaContext.Resolvers.RegisterMiddleware(middleware); }
private void Initialize(Action <IDirectiveTypeDescriptor> configure) { if (configure == null) { throw new ArgumentNullException(nameof(configure)); } DirectiveTypeDescriptor descriptor = CreateDescriptor(); configure(descriptor); DirectiveTypeDescription description = descriptor.CreateDescription(); ClrType = description.ClrType; SyntaxNode = description.SyntaxNode; Name = description.Name; Description = description.Description; Locations = description.Locations.ToList().AsReadOnly(); Arguments = new FieldCollection <InputField>( description.Arguments.Select(t => new InputField(t))); _middleware = description.Middleware; }