Skip to content

Commit

Permalink
Port #2459
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jan 23, 2023
1 parent cc92691 commit bae8169
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apollo-router/src/spec/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,11 +1144,10 @@ impl Operation {
fn from_hir(operation: &hir::OperationDefinition, schema: &Schema) -> Result<Self, SpecError> {
let name = operation.name().map(|s| s.to_owned());
let kind = operation.operation_ty().into();
let current_field_type = match kind {
OperationKind::Query => FieldType::Named("Query".to_string()),
OperationKind::Mutation => FieldType::Named("Mutation".to_string()),
OperationKind::Subscription => return Err(SpecError::SubscriptionNotSupported),
};
if kind == OperationKind::Subscription {
return Err(SpecError::SubscriptionNotSupported);
}
let current_field_type = FieldType::Named(schema.root_operation_name(kind).to_owned());
let selection_set = operation
.selection_set()
.selection()
Expand Down

0 comments on commit bae8169

Please sign in to comment.