@@ -29,7 +29,7 @@ void addErrorLocation(const schema_location& location, response::Value& error)
2929
3030 errorLocation.reserve (2 );
3131 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 )));
3333
3434 response::Value errorLocations (response::Type::List);
3535
@@ -254,7 +254,7 @@ void ValueVisitor::visitVariable(const peg::ast_node& variable)
254254
255255 error << " Unknown variable name: " << name;
256256
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 } } } };
258258 }
259259
260260 _value = response::Value (itr->second );
@@ -510,7 +510,7 @@ schema_location ResolverParams::getLocation() const
510510{
511511 auto position = field.begin ();
512512
513- return { position.line , position.byte_in_line };
513+ return { position.line , position.column };
514514}
515515
516516uint8_t Base64::verifyFromBase64 (char ch)
@@ -737,7 +737,7 @@ std::future<response::Value> ModifiedResult<response::IntType>::convert(FieldRes
737737
738738 error << " Field may not have sub-fields name: " << params.fieldName ;
739739
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 } } } };
741741 }
742742
743743 return resolve (std::move (result), std::move (params),
@@ -758,7 +758,7 @@ std::future<response::Value> ModifiedResult<response::FloatType>::convert(FieldR
758758
759759 error << " Field may not have sub-fields name: " << params.fieldName ;
760760
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 } } } };
762762 }
763763
764764 return resolve (std::move (result), std::move (params),
@@ -779,7 +779,7 @@ std::future<response::Value> ModifiedResult<response::StringType>::convert(Field
779779
780780 error << " Field may not have sub-fields name: " << params.fieldName ;
781781
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 } } } };
783783 }
784784
785785 return resolve (std::move (result), std::move (params),
@@ -800,7 +800,7 @@ std::future<response::Value> ModifiedResult<response::BooleanType>::convert(Fiel
800800
801801 error << " Field may not have sub-fields name: " << params.fieldName ;
802802
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 } } } };
804804 }
805805
806806 return resolve (std::move (result), std::move (params),
@@ -821,7 +821,7 @@ std::future<response::Value> ModifiedResult<response::Value>::convert(FieldResul
821821
822822 error << " Field may not have sub-fields name: " << params.fieldName ;
823823
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 } } } };
825825 }
826826
827827 return resolve (std::move (result), std::move (params),
@@ -842,7 +842,7 @@ std::future<response::Value> ModifiedResult<response::IdType>::convert(FieldResu
842842
843843 error << " Field may not have sub-fields name: " << params.fieldName ;
844844
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 } } } };
846846 }
847847
848848 return resolve (std::move (result), std::move (params),
@@ -863,7 +863,7 @@ std::future<response::Value> ModifiedResult<Object>::convert(FieldResult<std::sh
863863
864864 error << " Field must have sub-fields name: " << params.fieldName ;
865865
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 } } } };
867867 }
868868
869869 return std::async (params.launch ,
@@ -1013,7 +1013,7 @@ void SelectionVisitor::visitField(const peg::ast_node& field)
10131013 promise.set_exception (std::make_exception_ptr (
10141014 schema_exception { { schema_error{
10151015 error.str (),
1016- { position.line , position.byte_in_line },
1016+ { position.line , position.column },
10171017 { _path }
10181018 } } }));
10191019
@@ -1095,7 +1095,7 @@ void SelectionVisitor::visitField(const peg::ast_node& field)
10951095 {
10961096 if (message.location .line == 0 )
10971097 {
1098- message.location = { position.line , position.byte_in_line };
1098+ message.location = { position.line , position.column };
10991099 }
11001100
11011101 if (message.path .empty ())
@@ -1123,7 +1123,7 @@ void SelectionVisitor::visitField(const peg::ast_node& field)
11231123 promise.set_exception (std::make_exception_ptr (
11241124 schema_exception { { schema_error{
11251125 message.str (),
1126- { position.line , position.byte_in_line },
1126+ { position.line , position.column },
11271127 std::move (selectionSetParams.errorPath )
11281128 } } }));
11291129
@@ -1146,7 +1146,7 @@ void SelectionVisitor::visitFragmentSpread(const peg::ast_node& fragmentSpread)
11461146
11471147 error << " Unknown fragment name: " << name;
11481148
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 } } } };
11501150 }
11511151
11521152 bool skip = (_typeNames.count (itr->second .getType ()) == 0 );
@@ -1676,7 +1676,7 @@ void SubscriptionDefinitionVisitor::visitField(const peg::ast_node& field)
16761676
16771677 error << " Extra subscription root field name: " << name;
16781678
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 } } } };
16801680 }
16811681
16821682 DirectiveVisitor directiveVisitor (_params.variables );
@@ -1723,7 +1723,7 @@ void SubscriptionDefinitionVisitor::visitFragmentSpread(const peg::ast_node& fra
17231723
17241724 error << " Unknown fragment name: " << name;
17251725
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 } } } };
17271727 }
17281728
17291729 bool skip = !_subscriptionObject->matchesType (itr->second .getType ());
@@ -1852,7 +1852,7 @@ std::pair<std::string, const peg::ast_node*> Request::findOperationDefinition(co
18521852 message << " Duplicate named operations name: " << name;
18531853 }
18541854
1855- errors.push_back ({ message.str (), { position.line , position.byte_in_line } });
1855+ errors.push_back ({ message.str (), { position.line , position.column } });
18561856 }
18571857
18581858 hasAnonymous = hasAnonymous || name.empty ();
@@ -1873,7 +1873,7 @@ std::pair<std::string, const peg::ast_node*> Request::findOperationDefinition(co
18731873 message << " Unexpected named operation name: " << name;
18741874 }
18751875
1876- errors.push_back ({ message.str (), { position.line , position.byte_in_line } });
1876+ errors.push_back ({ message.str (), { position.line , position.column } });
18771877 }
18781878
18791879 auto itr = _operations.find (operationType);
@@ -1889,7 +1889,7 @@ std::pair<std::string, const peg::ast_node*> Request::findOperationDefinition(co
18891889 message << " name: " << name;
18901890 }
18911891
1892- errors.push_back ({ message.str (), { position.line , position.byte_in_line } });
1892+ errors.push_back ({ message.str (), { position.line , position.column } });
18931893 }
18941894
18951895 if (!errors.empty ())
@@ -1955,7 +1955,7 @@ std::future<response::Value> Request::resolveValidated(std::launch launch, const
19551955
19561956 message << " Unexpected type definition" ;
19571957
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 } } } };
19591959 }
19601960 }
19611961
@@ -1995,7 +1995,7 @@ std::future<response::Value> Request::resolveValidated(std::launch launch, const
19951995 message << " name: " << operationName;
19961996 }
19971997
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 } } } };
19991999 }
20002000
20012001 // http://spec.graphql.org/June2018/#sec-Normal-and-Serial-Execution
@@ -2069,7 +2069,7 @@ SubscriptionKey Request::subscribe(SubscriptionParams&& params, SubscriptionCall
20692069 message << " name: " << params.operationName ;
20702070 }
20712071
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 } } } };
20732073 }
20742074
20752075 auto itr = _operations.find (std::string { strSubscription });
0 commit comments