/// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public KnownArgumentNamesError(ValidationContext context, Argument node, FieldType fieldDef, IGraphType parentType)
     : base(context.Document.OriginalQuery, NUMBER,
            UnknownArgMessage(
                node.Name,
                fieldDef.Name,
                parentType.ToString(),
                StringUtils.SuggestionList(node.Name, fieldDef.Arguments?.List?.Select(q => q.Name))),
            node)
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public VariablesAreInputTypesError(ValidationContext context, VariableDefinition node, IGraphType type)
     : base(context.Document.OriginalQuery, NUMBER, UndefinedVarMessage(node.Name, type?.ToString() ?? node.Type.Name()), node)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public PossibleFragmentSpreadsError(ValidationContext context, FragmentSpread node, IGraphType parentType, IGraphType fragType)
     : base(context.Document.OriginalQuery, NUMBER, TypeIncompatibleSpreadMessage(node.Name, parentType.ToString(), fragType.ToString()), node)
 {
 }
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public VariablesInAllowedPositionError(ValidationContext context, GraphQLVariableDefinition varDef, IGraphType varType, VariableUsage usage)
     : base(context.Document.Source, NUMBER, BadVarPosMessage(usage.Node.Name.StringValue, varType.ToString() !, usage.Type.ToString() !))
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public ScalarLeafsError(ValidationContext context, Field node, IGraphType type)
     : base(context.Document.OriginalQuery, NUMBER, RequiredSubselectionMessage(node.Name, type.ToString()), node)
 {
 }
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public ScalarLeafsError(ValidationContext context, SelectionSet node, Field field, IGraphType type)
     : base(context.Document.OriginalQuery, NUMBER, NoSubselectionAllowedMessage(field.Name, type.ToString()), node)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public ScalarLeafsError(ValidationContext context, GraphQLField node, IGraphType type)
     : base(context.Document.Source, NUMBER, RequiredSubselectionMessage(node.Name.StringValue, type.ToString() !), node)
 {
 }
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public KnownArgumentNamesError(ValidationContext context, GraphQLArgument node, FieldType fieldDef, IGraphType parentType)
     : base(context.Document.Source, NUMBER,
            UnknownArgMessage(
                node.Name.StringValue,
                fieldDef.Name,
                parentType.ToString() !,
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public ScalarLeafsError(ValidationContext context, GraphQLSelectionSet node, GraphQLField field, IGraphType type)
     : base(context.Document.Source, NUMBER, NoSubselectionAllowedMessage(field.Name.StringValue, type.ToString() !), node)
 {
 }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public VariablesAreInputTypesError(ValidationContext context, GraphQLVariableDefinition node, IGraphType type)
     : base(context.Document.Source, NUMBER, UndefinedVarMessage(node.Variable.Name.StringValue, type?.ToString() ?? node.Type.Name()), node)
 {
 }
Esempio n. 11
0
        /// <summary>
        /// Initializes a new instance with the specified properties.
        /// </summary>
        public VariablesInAllowedPositionError(ValidationContext context, VariableDefinition varDef, IGraphType varType, VariableUsage usage)
            : base(context.Document.OriginalQuery, NUMBER, BadVarPosMessage(usage.Node.Name, varType.ToString(), usage.Type.ToString()))
        {
            var varDefPos = new Location(context.Document.OriginalQuery, varDef.SourceLocation.Start);
            var usagePos  = new Location(context.Document.OriginalQuery, usage.Node.SourceLocation.Start);

            AddLocation(varDefPos.Line, varDefPos.Column);
            AddLocation(usagePos.Line, usagePos.Column);
        }
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public DefaultValuesOfCorrectTypeError(ValidationContext context, GraphQLVariableDefinition varDefAst, IGraphType inputType, string verboseErrors)
     : base(context.Document.Source, NUMBER, BadValueForDefaultArgMessage(varDefAst.Variable.Name.StringValue, inputType.ToString() !, varDefAst.DefaultValue !.Print(), verboseErrors), varDefAst.DefaultValue !)
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public DefaultValuesOfCorrectTypeError(ValidationContext context, VariableDefinition varDefAst, IGraphType inputType, string verboseErrors)
     : base(context.Document.OriginalQuery, NUMBER, BadValueForDefaultArgMessage(varDefAst.Name, inputType.ToString(), varDefAst.DefaultValue.StringFrom(context.Document), verboseErrors), varDefAst.DefaultValue)
 {
 }