Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ermadmi78 committed Aug 30, 2021
1 parent 1b9fe91 commit aecc2dc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,23 @@ private class RegistryScope(
}

fun FieldDefinition.isPrimaryKey(): Boolean = directives.firstOrNull {
it.name == directiveLayout[KobbyDirective.PRIMARY_KEY] ?: KobbyDirective.PRIMARY_KEY
it.name == (directiveLayout[KobbyDirective.PRIMARY_KEY] ?: KobbyDirective.PRIMARY_KEY)
} != null

fun FieldDefinition.isRequired(): Boolean = directives.firstOrNull {
it.name == directiveLayout[KobbyDirective.REQUIRED] ?: KobbyDirective.REQUIRED
it.name == (directiveLayout[KobbyDirective.REQUIRED] ?: KobbyDirective.REQUIRED)
} != null

fun FieldDefinition.isDefault(): Boolean = directives.firstOrNull {
it.name == directiveLayout[KobbyDirective.DEFAULT] ?: KobbyDirective.DEFAULT
it.name == (directiveLayout[KobbyDirective.DEFAULT] ?: KobbyDirective.DEFAULT)
} != null

fun FieldDefinition.isSelection(): Boolean = directives.firstOrNull {
it.name == directiveLayout[KobbyDirective.SELECTION] ?: KobbyDirective.SELECTION
it.name == (directiveLayout[KobbyDirective.SELECTION] ?: KobbyDirective.SELECTION)
} != null

fun FieldDefinition.isResolve(): Boolean = directives.firstOrNull {
it.name == directiveLayout[KobbyDirective.RESOLVE] ?: KobbyDirective.RESOLVE
it.name == (directiveLayout[KobbyDirective.RESOLVE] ?: KobbyDirective.RESOLVE)
} != null
}

Expand Down

0 comments on commit aecc2dc

Please sign in to comment.