File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -855,6 +855,27 @@ def test_parse_nested_inline_fragments_on_same_node
855
855
assert_equal "secret" , user . password
856
856
end
857
857
858
+ def test_parse_fragment_with_field_named_error
859
+ Temp . const_set :UserFragment , @client . parse ( <<-'GRAPHQL' )
860
+ fragment on User {
861
+ errors: profileName
862
+ }
863
+ GRAPHQL
864
+
865
+ Temp . const_set :Query , @client . parse ( <<-'GRAPHQL' )
866
+ {
867
+ node(id: "1") {
868
+ ...TestQueryResult::Temp::UserFragment
869
+ }
870
+ }
871
+ GRAPHQL
872
+
873
+ response = @client . query ( Temp ::Query )
874
+ user = Temp ::UserFragment . new ( response . data . node )
875
+
876
+ assert_equal "Josh" , user . errors
877
+ end
878
+
858
879
def test_parse_fragment_query_result_aliases
859
880
Temp . const_set :UserFragment , @client . parse ( <<-'GRAPHQL' )
860
881
fragment on User {
You can’t perform that action at this time.
0 commit comments