File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,19 @@ def get_named_type(type_name: str) -> GraphQLNamedType:
104
104
def get_input_type (type_ref : Dict ) -> GraphQLInputType :
105
105
input_type = get_type (type_ref )
106
106
if not is_input_type (input_type ):
107
- raise TypeError ("Introspection must provide input type for arguments." )
107
+ raise TypeError (
108
+ "Introspection must provide input type for arguments,"
109
+ f" but received: { inspect (input_type )} ."
110
+ )
108
111
return cast (GraphQLInputType , input_type )
109
112
110
113
def get_output_type (type_ref : Dict ) -> GraphQLOutputType :
111
114
output_type = get_type (type_ref )
112
115
if not is_output_type (output_type ):
113
- raise TypeError ("Introspection must provide output type for fields." )
116
+ raise TypeError (
117
+ "Introspection must provide output type for fields,"
118
+ f" but received: { inspect (output_type )} ."
119
+ )
114
120
return cast (GraphQLOutputType , output_type )
115
121
116
122
def get_object_type (type_ref : Dict ) -> GraphQLObjectType :
Original file line number Diff line number Diff line change @@ -598,7 +598,8 @@ def throws_when_output_type_is_used_as_an_arg_type():
598
598
599
599
assert str (exc_info .value ).startswith (
600
600
"Query fields cannot be resolved:"
601
- " Introspection must provide input type for arguments."
601
+ " Introspection must provide input type for arguments,"
602
+ " but received: SomeUnion."
602
603
)
603
604
604
605
def throws_when_input_type_is_used_as_a_field_type ():
@@ -617,7 +618,8 @@ def throws_when_input_type_is_used_as_a_field_type():
617
618
618
619
assert str (exc_info .value ).startswith (
619
620
"Query fields cannot be resolved:"
620
- " Introspection must provide output type for fields."
621
+ " Introspection must provide output type for fields,"
622
+ " but received: SomeInputObject."
621
623
)
622
624
623
625
def throws_when_missing_possible_types ():
You can’t perform that action at this time.
0 commit comments