io.github.darvld.wireframe.extensions.Analysis.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler-core Show documentation
Show all versions of compiler-core Show documentation
A GraphQL server library for Kotlin.
package io.github.darvld.wireframe.extensions
import graphql.schema.*
public fun GraphQLNamedType.isInternalType(): Boolean {
return GraphQLTypeUtil.isSystemElement().test(this)
}
public fun GraphQLNamedType.isRouteType(): Boolean {
if (name == "Query" || name == "Mutation" || name == "Subscription") return true
return false
}
public val GraphQLType.isNullable: Boolean
get() = this is GraphQLNullableType
public fun GraphQLType.unwrapNonNull(): GraphQLType {
return if (this is GraphQLNonNull) originalWrappedType else this
}
public tailrec fun GraphQLType.unwrapCompletely(): GraphQLType {
return if (this is GraphQLModifiedType) wrappedType.unwrapCompletely() else this
}
public fun GraphQLObjectType.getExtensionFields(): Sequence {
val extensions = extensionDefinitions.flatMap { extension ->
extension.fieldDefinitions.map { it.name!! }
}
return fields.asSequence().filter { it.name in extensions }
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy