コード例 #1
0
        /// <summary>
        /// Creates a set of event names representing all the possible forms of the event as defined
        /// by the graph field.
        /// </summary>
        /// <param name="schemaType">The raw data type of the target schema.</param>
        /// <param name="field">The field to create names for.</param>
        /// <returns>IEnumerable&lt;SubscriptionEventName&gt;.</returns>
        private static IEnumerable <SubscriptionEventName> FromSchemaTypeAndField(Type schemaType, ISubscriptionGraphField field)
        {
            yield return(new SubscriptionEventName(schemaType, field.Route.Path));

            if (!string.IsNullOrWhiteSpace(field.EventName))
            {
                yield return(new SubscriptionEventName(schemaType, field.EventName));
            }
        }
コード例 #2
0
 /// <summary>
 /// Creates a set of event names representing all the possible forms of the event as defined
 /// by the grpah field.
 /// </summary>
 /// <typeparam name="TSchema">The type of the schema the graph field exists in.</typeparam>
 /// <param name="field">The field to create names for.</param>
 /// <returns>IEnumerable&lt;SubscriptionEventName&gt;.</returns>
 public static IEnumerable <SubscriptionEventName> FromGraphField <TSchema>(ISubscriptionGraphField field)
     where TSchema : class, ISchema
 {
     Validation.ThrowIfNull(field, nameof(field));
     return(SubscriptionEventName.FromSchemaTypeAndField(typeof(TSchema), field));
 }
コード例 #3
0
 /// <summary>
 /// Creates a set of event names representing all the possible forms of the event as defined
 /// by the graph field.
 /// </summary>
 /// <param name="schema">The schema owning the field definition.</param>
 /// <param name="field">The field to create names for.</param>
 /// <returns>IEnumerable&lt;SubscriptionEventName&gt;.</returns>
 public static IEnumerable <SubscriptionEventName> FromGraphField(ISchema schema, ISubscriptionGraphField field)
 {
     Validation.ThrowIfNull(schema, nameof(schema));
     Validation.ThrowIfNull(field, nameof(field));
     return(SubscriptionEventName.FromSchemaTypeAndField(schema.GetType(), field));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApolloSubscriptionFieldEventArgs" /> class.
 /// </summary>
 /// <param name="graphField">The graph field.</param>
 public ApolloSubscriptionFieldEventArgs(ISubscriptionGraphField graphField)
 {
     this.Field = Validation.ThrowIfNullOrReturn(graphField, nameof(graphField));
 }