Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryDirective" /> class.
 /// </summary>
 /// <param name="node">The node denoting the directive.</param>
 /// <param name="directive">The directive pulled from the target schema.</param>
 /// <param name="location">The location in the source document where this directive instance was seen.</param>
 public QueryDirective(DirectiveNode node, IDirectiveGraphType directive, DirectiveLocation location)
 {
     this.Node      = Validation.ThrowIfNullOrReturn(node, nameof(node));
     this.Directive = Validation.ThrowIfNullOrReturn(directive, nameof(directive));
     this.Location  = location;
     this.Arguments = new QueryInputArgumentCollection();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GraphDirectiveExecutionContext"/> class.
 /// </summary>
 /// <param name="seenAtLocation">The seen at location.</param>
 /// <param name="graphType">Type of the graph.</param>
 /// <param name="origin">The origin.</param>
 public GraphDirectiveExecutionContext(DirectiveLocation seenAtLocation, IDirectiveGraphType graphType, SourceOrigin origin)
 {
     this.Location  = seenAtLocation;
     this.Directive = graphType;
     this.Origin    = origin;
     this.Arguments = new InputArgumentCollection();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GraphDirectiveRequest" /> class.
 /// </summary>
 /// <param name="targetDirective">The target directive.</param>
 /// <param name="location">The location.</param>
 /// <param name="origin">The origin.</param>
 /// <param name="requestMetaData">The request meta data.</param>
 public GraphDirectiveRequest(
     IDirectiveGraphType targetDirective,
     DirectiveLocation location,
     SourceOrigin origin,
     MetaDataCollection requestMetaData = null)
 {
     this.Id                = Guid.NewGuid().ToString("N");
     this.Directive         = Validation.ThrowIfNullOrReturn(targetDirective, nameof(targetDirective));
     this.LifeCycle         = DirectiveLifeCycle.BeforeResolution;
     this.DirectiveLocation = location;
     this.Origin            = origin ?? SourceOrigin.None;
     this.Items             = requestMetaData ?? new MetaDataCollection();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="IntrospectedDirective" /> class.
 /// </summary>
 /// <param name="directiveType">Type of the directive.</param>
 public IntrospectedDirective(IDirectiveGraphType directiveType)
 {
     this.GraphType = directiveType;
 }