public OperationModel( NameString name, ObjectType type, DocumentNode document, OperationType operationType, IReadOnlyList <ArgumentModel> arguments, OutputTypeModel resultType, IReadOnlyList <LeafTypeModel> leafTypes, IReadOnlyList <InputObjectTypeModel> inputObjectTypes, IReadOnlyList <OutputTypeModel> outputTypeModels, IReadOnlyDictionary <SelectionSetInfo, SelectionSetNode> selectionSets) { Name = name.EnsureNotEmpty(nameof(name)); Type = type ?? throw new ArgumentNullException(nameof(type)); Document = document ?? throw new ArgumentNullException(nameof(document)); OperationType = operationType; Arguments = arguments ?? throw new ArgumentNullException(nameof(arguments)); ResultType = resultType ?? throw new ArgumentNullException(nameof(resultType)); LeafTypes = leafTypes ?? throw new ArgumentNullException(nameof(leafTypes)); InputObjectTypes = inputObjectTypes ?? throw new ArgumentNullException(nameof(inputObjectTypes)); OutputTypes = outputTypeModels ?? throw new ArgumentNullException(nameof(outputTypeModels)); _selectionSets = selectionSets ?? throw new ArgumentNullException(nameof(selectionSets)); }
public IEnumerable <OutputTypeModel> GetImplementations(OutputTypeModel outputType) { if (outputType is null) { throw new ArgumentNullException(nameof(outputType)); } foreach (var model in OutputTypes) { if (model.Implements.Contains(outputType)) { yield return(model); } } }