Skip to content

Commit 5ffb8a9

Browse files
authored
Merge pull request #460 from Enselic/more-help
Improve error message when query name is missing
2 parents c52e89e + b1173b0 commit 5ffb8a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphql_client_codegen/src/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ where
154154
) => {
155155
let on = schema.query_type();
156156
let resolved_operation: ResolvedOperation = ResolvedOperation {
157-
name: q.name.as_ref().expect("query without name").as_ref().into(),
157+
name: q.name.as_ref().expect("query without name. Instead of `query (...)`, write `query SomeName(...)` in your .graphql file").as_ref().into(),
158158
_operation_type: operations::OperationType::Query,
159159
object_id: on,
160160
selection_set: Vec::with_capacity(q.selection_set.items.len()),

0 commit comments

Comments
 (0)