Skip to content

Commit

Permalink
When on sealed class must be exhaustive
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed Jul 10, 2023
1 parent 1d0b3fa commit 829893a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private fun GQLDefinition.walk(issues: MutableList<Issue>) {
when (this) {
is GQLOperationDefinition -> selections.forEach { it.walk(issues) }
is GQLFragmentDefinition -> selections.forEach { it.walk(issues) }
else -> {}
}
}

Expand All @@ -36,10 +37,13 @@ private fun GQLSelection.walk(issues: MutableList<Issue>) {
is GQLField -> {
selections.forEach { it.walk(issues) }
}

is GQLInlineFragment -> {
if (typeCondition == null) {
issues.add(Issue.InlineFragmentWithoutTypeCondition("Inline fragments without a type condition are not supported. Add the parent type to inline fragment.", this.sourceLocation))
}
}

else -> {}
}
}
}

0 comments on commit 829893a

Please sign in to comment.