@@ -29,7 +29,7 @@ void addErrorLocation(const schema_location& location, response::Value& error)
29
29
30
30
errorLocation.reserve (2 );
31
31
errorLocation.emplace_back (std::string { strLine }, response::Value (static_cast <response::IntType>(location.line )));
32
- errorLocation.emplace_back (std::string { strColumn }, response::Value (static_cast <response::IntType>(location.byte_in_line + 1 )));
32
+ errorLocation.emplace_back (std::string { strColumn }, response::Value (static_cast <response::IntType>(location.column )));
33
33
34
34
response::Value errorLocations (response::Type::List);
35
35
@@ -254,7 +254,7 @@ void ValueVisitor::visitVariable(const peg::ast_node& variable)
254
254
255
255
error << " Unknown variable name: " << name;
256
256
257
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line } } } };
257
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column } } } };
258
258
}
259
259
260
260
_value = response::Value (itr->second );
@@ -510,7 +510,7 @@ schema_location ResolverParams::getLocation() const
510
510
{
511
511
auto position = field.begin ();
512
512
513
- return { position.line , position.byte_in_line };
513
+ return { position.line , position.column };
514
514
}
515
515
516
516
uint8_t Base64::verifyFromBase64 (char ch)
@@ -737,7 +737,7 @@ std::future<response::Value> ModifiedResult<response::IntType>::convert(FieldRes
737
737
738
738
error << " Field may not have sub-fields name: " << params.fieldName ;
739
739
740
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
740
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
741
741
}
742
742
743
743
return resolve (std::move (result), std::move (params),
@@ -758,7 +758,7 @@ std::future<response::Value> ModifiedResult<response::FloatType>::convert(FieldR
758
758
759
759
error << " Field may not have sub-fields name: " << params.fieldName ;
760
760
761
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
761
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
762
762
}
763
763
764
764
return resolve (std::move (result), std::move (params),
@@ -779,7 +779,7 @@ std::future<response::Value> ModifiedResult<response::StringType>::convert(Field
779
779
780
780
error << " Field may not have sub-fields name: " << params.fieldName ;
781
781
782
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
782
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
783
783
}
784
784
785
785
return resolve (std::move (result), std::move (params),
@@ -800,7 +800,7 @@ std::future<response::Value> ModifiedResult<response::BooleanType>::convert(Fiel
800
800
801
801
error << " Field may not have sub-fields name: " << params.fieldName ;
802
802
803
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
803
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
804
804
}
805
805
806
806
return resolve (std::move (result), std::move (params),
@@ -821,7 +821,7 @@ std::future<response::Value> ModifiedResult<response::Value>::convert(FieldResul
821
821
822
822
error << " Field may not have sub-fields name: " << params.fieldName ;
823
823
824
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
824
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
825
825
}
826
826
827
827
return resolve (std::move (result), std::move (params),
@@ -842,7 +842,7 @@ std::future<response::Value> ModifiedResult<response::IdType>::convert(FieldResu
842
842
843
843
error << " Field may not have sub-fields name: " << params.fieldName ;
844
844
845
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
845
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
846
846
}
847
847
848
848
return resolve (std::move (result), std::move (params),
@@ -863,7 +863,7 @@ std::future<response::Value> ModifiedResult<Object>::convert(FieldResult<std::sh
863
863
864
864
error << " Field must have sub-fields name: " << params.fieldName ;
865
865
866
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { params.errorPath } } } };
866
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { params.errorPath } } } };
867
867
}
868
868
869
869
return std::async (params.launch ,
@@ -1013,7 +1013,7 @@ void SelectionVisitor::visitField(const peg::ast_node& field)
1013
1013
promise.set_exception (std::make_exception_ptr (
1014
1014
schema_exception { { schema_error{
1015
1015
error.str (),
1016
- { position.line , position.byte_in_line },
1016
+ { position.line , position.column },
1017
1017
{ _path }
1018
1018
} } }));
1019
1019
@@ -1095,7 +1095,7 @@ void SelectionVisitor::visitField(const peg::ast_node& field)
1095
1095
{
1096
1096
if (message.location .line == 0 )
1097
1097
{
1098
- message.location = { position.line , position.byte_in_line };
1098
+ message.location = { position.line , position.column };
1099
1099
}
1100
1100
1101
1101
if (message.path .empty ())
@@ -1123,7 +1123,7 @@ void SelectionVisitor::visitField(const peg::ast_node& field)
1123
1123
promise.set_exception (std::make_exception_ptr (
1124
1124
schema_exception { { schema_error{
1125
1125
message.str (),
1126
- { position.line , position.byte_in_line },
1126
+ { position.line , position.column },
1127
1127
std::move (selectionSetParams.errorPath )
1128
1128
} } }));
1129
1129
@@ -1146,7 +1146,7 @@ void SelectionVisitor::visitFragmentSpread(const peg::ast_node& fragmentSpread)
1146
1146
1147
1147
error << " Unknown fragment name: " << name;
1148
1148
1149
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line }, { _path } } } };
1149
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column }, { _path } } } };
1150
1150
}
1151
1151
1152
1152
bool skip = (_typeNames.count (itr->second .getType ()) == 0 );
@@ -1676,7 +1676,7 @@ void SubscriptionDefinitionVisitor::visitField(const peg::ast_node& field)
1676
1676
1677
1677
error << " Extra subscription root field name: " << name;
1678
1678
1679
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line } } } };
1679
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column } } } };
1680
1680
}
1681
1681
1682
1682
DirectiveVisitor directiveVisitor (_params.variables );
@@ -1723,7 +1723,7 @@ void SubscriptionDefinitionVisitor::visitFragmentSpread(const peg::ast_node& fra
1723
1723
1724
1724
error << " Unknown fragment name: " << name;
1725
1725
1726
- throw schema_exception { { schema_error{ error.str (), { position.line , position.byte_in_line } } } };
1726
+ throw schema_exception { { schema_error{ error.str (), { position.line , position.column } } } };
1727
1727
}
1728
1728
1729
1729
bool skip = !_subscriptionObject->matchesType (itr->second .getType ());
@@ -1852,7 +1852,7 @@ std::pair<std::string, const peg::ast_node*> Request::findOperationDefinition(co
1852
1852
message << " Duplicate named operations name: " << name;
1853
1853
}
1854
1854
1855
- errors.push_back ({ message.str (), { position.line , position.byte_in_line } });
1855
+ errors.push_back ({ message.str (), { position.line , position.column } });
1856
1856
}
1857
1857
1858
1858
hasAnonymous = hasAnonymous || name.empty ();
@@ -1873,7 +1873,7 @@ std::pair<std::string, const peg::ast_node*> Request::findOperationDefinition(co
1873
1873
message << " Unexpected named operation name: " << name;
1874
1874
}
1875
1875
1876
- errors.push_back ({ message.str (), { position.line , position.byte_in_line } });
1876
+ errors.push_back ({ message.str (), { position.line , position.column } });
1877
1877
}
1878
1878
1879
1879
auto itr = _operations.find (operationType);
@@ -1889,7 +1889,7 @@ std::pair<std::string, const peg::ast_node*> Request::findOperationDefinition(co
1889
1889
message << " name: " << name;
1890
1890
}
1891
1891
1892
- errors.push_back ({ message.str (), { position.line , position.byte_in_line } });
1892
+ errors.push_back ({ message.str (), { position.line , position.column } });
1893
1893
}
1894
1894
1895
1895
if (!errors.empty ())
@@ -1955,7 +1955,7 @@ std::future<response::Value> Request::resolveValidated(std::launch launch, const
1955
1955
1956
1956
message << " Unexpected type definition" ;
1957
1957
1958
- throw schema_exception { { schema_error{ message.str (), { position.line , position.byte_in_line } } } };
1958
+ throw schema_exception { { schema_error{ message.str (), { position.line , position.column } } } };
1959
1959
}
1960
1960
}
1961
1961
@@ -1995,7 +1995,7 @@ std::future<response::Value> Request::resolveValidated(std::launch launch, const
1995
1995
message << " name: " << operationName;
1996
1996
}
1997
1997
1998
- throw schema_exception { { schema_error{ message.str (), { position.line , position.byte_in_line } } } };
1998
+ throw schema_exception { { schema_error{ message.str (), { position.line , position.column } } } };
1999
1999
}
2000
2000
2001
2001
// http://spec.graphql.org/June2018/#sec-Normal-and-Serial-Execution
@@ -2069,7 +2069,7 @@ SubscriptionKey Request::subscribe(SubscriptionParams&& params, SubscriptionCall
2069
2069
message << " name: " << params.operationName ;
2070
2070
}
2071
2071
2072
- throw schema_exception { { schema_error{ message.str (), { position.line , position.byte_in_line } } } };
2072
+ throw schema_exception { { schema_error{ message.str (), { position.line , position.column } } } };
2073
2073
}
2074
2074
2075
2075
auto itr = _operations.find (std::string { strSubscription });
0 commit comments