graphql.nadel.enginekt.transform.result.NadelResultInstruction.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nadel-engine-nextgen Show documentation
Show all versions of nadel-engine-nextgen Show documentation
Nadel is a Java library that combines multiple GrahpQL services together into one API.
The newest version!
package graphql.nadel.enginekt.transform.result
import graphql.GraphQLError
import graphql.nadel.enginekt.transform.result.json.JsonNodePath
sealed class NadelResultInstruction {
data class Set(
override val subjectPath: JsonNodePath,
val newValue: Any?,
) : NadelResultInstruction(), NadelResultInstructionWithSubject
data class Remove(
override val subjectPath: JsonNodePath,
) : NadelResultInstruction(), NadelResultInstructionWithSubject
data class Copy(
override val subjectPath: JsonNodePath,
val destinationPath: JsonNodePath,
) : NadelResultInstruction(), NadelResultInstructionWithSubject {
val destinationKey: String
get() = destinationPath.segments.last().value as String
}
data class AddError(
val error: GraphQLError,
) : NadelResultInstruction()
}
interface NadelResultInstructionWithSubject {
val subjectPath: JsonNodePath
val subjectKey: String
get() = subjectPath.segments.last().value as String
}