@@ -5,6 +5,7 @@ use crate::sql_types::*;
55use graphql_parser:: query:: * ;
66use serde:: Serialize ;
77use std:: collections:: HashMap ;
8+ use std:: hash:: Hash ;
89use std:: ops:: Deref ;
910use std:: str:: FromStr ;
1011use std:: sync:: Arc ;
@@ -264,6 +265,7 @@ pub fn to_insert_builder<'a, T>(
264265) -> Result < InsertBuilder , String >
265266where
266267 T : Text < ' a > + Eq + AsRef < str > + Clone ,
268+ T :: Value : Hash ,
267269{
268270 let type_ = field. type_ ( ) . unmodified_type ( ) ;
269271 let type_name = type_
@@ -429,6 +431,7 @@ pub fn to_update_builder<'a, T>(
429431) -> Result < UpdateBuilder , String >
430432where
431433 T : Text < ' a > + Eq + AsRef < str > + Clone ,
434+ T :: Value : Hash ,
432435{
433436 let type_ = field. type_ ( ) . unmodified_type ( ) ;
434437 let type_name = type_
@@ -534,6 +537,7 @@ pub fn to_delete_builder<'a, T>(
534537) -> Result < DeleteBuilder , String >
535538where
536539 T : Text < ' a > + Eq + AsRef < str > + Clone ,
540+ T :: Value : Hash ,
537541{
538542 let type_ = field. type_ ( ) . unmodified_type ( ) ;
539543 let type_name = type_
@@ -643,6 +647,7 @@ pub fn to_function_call_builder<'a, T>(
643647) -> Result < FunctionCallBuilder , String >
644648where
645649 T : Text < ' a > + Eq + AsRef < str > + Clone ,
650+ T :: Value : Hash ,
646651{
647652 let type_ = field. type_ ( ) . unmodified_type ( ) ;
648653 let alias = alias_or_name ( query_field) ;
@@ -1337,6 +1342,7 @@ pub fn to_connection_builder<'a, T>(
13371342) -> Result < ConnectionBuilder , String >
13381343where
13391344 T : Text < ' a > + Eq + AsRef < str > + Clone ,
1345+ T :: Value : Hash ,
13401346{
13411347 let type_ = field. type_ ( ) . unmodified_type ( ) ;
13421348 let type_ = type_. return_type ( ) ;
@@ -1510,6 +1516,7 @@ fn to_page_info_builder<'a, T>(
15101516) -> Result < PageInfoBuilder , String >
15111517where
15121518 T : Text < ' a > + Eq + AsRef < str > + Clone ,
1519+ T :: Value : Hash ,
15131520{
15141521 let type_ = field. type_ ( ) . unmodified_type ( ) ;
15151522 let type_name = type_. name ( ) . ok_or ( format ! (
@@ -1572,6 +1579,7 @@ fn to_edge_builder<'a, T>(
15721579) -> Result < EdgeBuilder , String >
15731580where
15741581 T : Text < ' a > + Eq + AsRef < str > + Clone ,
1582+ T :: Value : Hash ,
15751583{
15761584 let type_ = field. type_ ( ) . unmodified_type ( ) ;
15771585 let type_name = type_. name ( ) . ok_or ( format ! (
@@ -1639,6 +1647,7 @@ pub fn to_node_builder<'a, T>(
16391647) -> Result < NodeBuilder , String >
16401648where
16411649 T : Text < ' a > + Eq + AsRef < str > + Clone ,
1650+ T :: Value : Hash ,
16421651{
16431652 let type_ = field. type_ ( ) . unmodified_type ( ) ;
16441653
@@ -1982,6 +1991,7 @@ impl __Schema {
19821991 ) -> Result < __EnumValueBuilder , String >
19831992 where
19841993 T : Text < ' a > + Eq + AsRef < str > + Clone ,
1994+ T :: Value : Hash ,
19851995 {
19861996 let selection_fields = normalize_selection_set (
19871997 & query_field. selection_set ,
@@ -2034,6 +2044,7 @@ impl __Schema {
20342044 ) -> Result < __InputValueBuilder , String >
20352045 where
20362046 T : Text < ' a > + Eq + AsRef < str > + Clone ,
2047+ T :: Value : Hash ,
20372048 {
20382049 let selection_fields = normalize_selection_set (
20392050 & query_field. selection_set ,
@@ -2099,6 +2110,7 @@ impl __Schema {
20992110 ) -> Result < __FieldBuilder , String >
21002111 where
21012112 T : Text < ' a > + Eq + AsRef < str > + Clone ,
2113+ T :: Value : Hash ,
21022114 {
21032115 let selection_fields = normalize_selection_set (
21042116 & query_field. selection_set ,
@@ -2175,6 +2187,7 @@ impl __Schema {
21752187 ) -> Result < Option < __TypeBuilder > , String >
21762188 where
21772189 T : Text < ' a > + Eq + AsRef < str > + Clone ,
2190+ T :: Value : Hash ,
21782191 {
21792192 if field. type_ . unmodified_type ( ) != __Type:: __Type ( __TypeType { } ) {
21802193 return Err ( "can not build query for non-__type type" . to_string ( ) ) ;
@@ -2227,6 +2240,7 @@ impl __Schema {
22272240 ) -> Result < __TypeBuilder , String >
22282241 where
22292242 T : Text < ' a > + Eq + AsRef < str > + Clone ,
2243+ T :: Value : Hash ,
22302244 {
22312245 let field_map = field_map ( & __Type:: __Type ( __TypeType { } ) ) ;
22322246
@@ -2421,6 +2435,7 @@ impl __Schema {
24212435 ) -> Result < __DirectiveBuilder , String >
24222436 where
24232437 T : Text < ' a > + Eq + AsRef < str > + Clone ,
2438+ T :: Value : Hash ,
24242439 {
24252440 let selection_fields = normalize_selection_set (
24262441 & query_field. selection_set ,
@@ -2490,6 +2505,7 @@ impl __Schema {
24902505 ) -> Result < __SchemaBuilder , String >
24912506 where
24922507 T : Text < ' a > + Eq + AsRef < str > + Clone ,
2508+ T :: Value : Hash ,
24932509 {
24942510 let type_ = field. type_ . unmodified_type ( ) ;
24952511 let type_name = type_
0 commit comments