@@ -10,11 +10,11 @@ pub enum GraphQLError {
10
10
Parse ( String ) ,
11
11
12
12
/// Field resolution errors
13
- #[ error( "Field not found: {field} on type {type_name}" ) ]
13
+ #[ error( "Unknown field \" {field}\" on type {type_name}" ) ]
14
14
FieldNotFound { field : String , type_name : String } ,
15
15
16
16
/// General operation errors with context
17
- #[ error( "{context}: { message}" ) ]
17
+ #[ error( "{message}" ) ]
18
18
Operation { context : String , message : String } ,
19
19
}
20
20
@@ -43,11 +43,6 @@ impl From<&str> for GraphQLError {
43
43
}
44
44
45
45
impl GraphQLError {
46
- /// Creates a parse error
47
- pub fn parse ( message : impl Into < String > ) -> Self {
48
- Self :: Parse ( message. into ( ) )
49
- }
50
-
51
46
/// Creates a field not found error
52
47
pub fn field_not_found ( field : impl Into < String > , type_name : impl Into < String > ) -> Self {
53
48
Self :: FieldNotFound {
@@ -104,14 +99,6 @@ impl GraphQLError {
104
99
}
105
100
}
106
101
107
- /// Creates an authorization error
108
- pub fn authorization ( message : impl Into < String > ) -> Self {
109
- Self :: Operation {
110
- context : "Authorization error" . to_string ( ) ,
111
- message : message. into ( ) ,
112
- }
113
- }
114
-
115
102
/// Creates an internal error
116
103
pub fn internal ( message : impl Into < String > ) -> Self {
117
104
Self :: Operation {
@@ -120,21 +107,6 @@ impl GraphQLError {
120
107
}
121
108
}
122
109
123
- /// Creates an unsupported operation error
124
- pub fn unsupported_operation ( operation : impl Into < String > ) -> Self {
125
- Self :: Operation {
126
- context : "Operation not supported" . to_string ( ) ,
127
- message : operation. into ( ) ,
128
- }
129
- }
130
-
131
- /// Creates a configuration error
132
- pub fn configuration ( message : impl Into < String > ) -> Self {
133
- Self :: Operation {
134
- context : "Configuration error" . to_string ( ) ,
135
- message : message. into ( ) ,
136
- }
137
- }
138
110
}
139
111
140
112
/// Type alias for Results that use GraphQLError
0 commit comments