Skip to content

Commit d14bcb6

Browse files
martinbonninBoD
andauthored
Add support for @catch and @semanticNonNull (#5405)
* add nullability foreign schema * add FieldResult and various catchTo adapters * Add IrType.result * add catch test * support for @nullOnlyOnError and @catch * Update libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/definitions.kt Co-authored-by: Benoit Lubek <[email protected]> * Update libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/definitions.kt Co-authored-by: Benoit Lubek <[email protected]> * Update libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/definitions.kt Co-authored-by: Benoit Lubek <[email protected]> * findCatch -> findCatches * use the presence of the `@catch` directive definition to enable codegen * Add @ignoreErrors and ErrorAwareAdapter. Remove CatchToThrowAdapter * update test fixtures * fix test * fix nullable + catchToNull * nullOnlyOnError -> semanticNonNull * add ApolloExperimental * fix api dump * allow setting a default on the schema for @catch * add catch(to: THROW) * enforce chosing a default CatchTo * add validation for @catch * add validation for @catch * update api dump * fix ParserTest * fix tests * FieldResult.error -> FieldResult.exception * update message * simpler * Update libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Adapters.kt Co-authored-by: Benoit Lubek <[email protected]> * Update libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/gqldirective.kt Co-authored-by: Benoit Lubek <[email protected]> * Update libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/internal/definitions.kt Co-authored-by: Benoit Lubek <[email protected]> * nooe -> semanticNonNull * fix bad copy paste * update apiDump * hide some more symbol * allow to catch non-ApolloGraphQLException * comment + reorder code * valueOrNull -> getOrNull for consistency * API visibility * simplify code and does not generate errorAware() adapter wrappers for non-null types * add an quick test * fix tests --------- Co-authored-by: Benoit Lubek <[email protected]>
1 parent 0fc496f commit d14bcb6

File tree

454 files changed

+3061
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+3061
-467
lines changed

.idea/runConfigurations/CodegenTest.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build-logic/src/main/kotlin/Testing.kt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
88

99
fun Project.configureTesting() {
1010
tasks.withType(Test::class.java) {
11-
systemProperty("updateTestFixtures", System.getProperty("updateTestFixtures"))
12-
systemProperty("testFilter", System.getProperty("testFilter"))
13-
systemProperty("codegenModels", System.getProperty("codegenModels"))
14-
11+
forwardEnv("updateTestFixtures")
12+
forwardEnv("testFilter")
13+
forwardEnv("codegenModels")
1514
}
1615

1716
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
@@ -35,6 +34,16 @@ fun Project.configureTesting() {
3534
}
3635
}
3736

37+
/**
38+
* forwards an environment variable to a test task and mark it as input
39+
*/
40+
fun Test.forwardEnv(name: String) {
41+
System.getenv(name)?.let { value ->
42+
environment(name, value)
43+
inputs.property(name, value)
44+
}
45+
}
46+
3847
// See https://github.com/gradle/gradle/issues/23456
3948
fun Test.addRelativeInput(name: String, dirPath: Any) {
4049
this.inputs.dir(dirPath).withPropertyName(name).withPathSensitivity(PathSensitivity.RELATIVE)

libraries/apollo-api/api/apollo-api.api

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public final class com/apollographql/apollo3/api/Adapters {
2222
public static final field NullableStringAdapter Lcom/apollographql/apollo3/api/NullableAdapter;
2323
public static final field StringAdapter Lcom/apollographql/apollo3/api/Adapter;
2424
public static final field UploadAdapter Lcom/apollographql/apollo3/api/Adapter;
25+
public static final fun -catchToNull (Lcom/apollographql/apollo3/api/Adapter;)Lcom/apollographql/apollo3/api/Adapter;
26+
public static final fun -catchToResult (Lcom/apollographql/apollo3/api/Adapter;)Lcom/apollographql/apollo3/api/Adapter;
27+
public static final fun -errorAware (Lcom/apollographql/apollo3/api/Adapter;)Lcom/apollographql/apollo3/api/Adapter;
2528
public static final fun -list (Lcom/apollographql/apollo3/api/Adapter;)Lcom/apollographql/apollo3/api/ListAdapter;
2629
public static final fun -nullable (Lcom/apollographql/apollo3/api/Adapter;)Lcom/apollographql/apollo3/api/NullableAdapter;
2730
public static final fun -obj (Lcom/apollographql/apollo3/api/Adapter;Z)Lcom/apollographql/apollo3/api/ObjectAdapter;
@@ -382,8 +385,9 @@ public final class com/apollographql/apollo3/api/CustomScalarAdapters : com/apol
382385
public static final field Key Lcom/apollographql/apollo3/api/CustomScalarAdapters$Key;
383386
public static final field PassThrough Lcom/apollographql/apollo3/api/CustomScalarAdapters;
384387
public final field deferredFragmentIdentifiers Ljava/util/Set;
388+
public final field errors Ljava/util/List;
385389
public final field falseVariables Ljava/util/Set;
386-
public synthetic fun <init> (Ljava/util/Map;Ljava/util/Set;Ljava/util/Set;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V
390+
public synthetic fun <init> (Ljava/util/Map;Ljava/util/Set;Ljava/util/Set;Ljava/util/List;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V
387391
public final fun adapterFor (Ljava/lang/String;)Lcom/apollographql/apollo3/api/Adapter;
388392
public fun getKey ()Lcom/apollographql/apollo3/api/ExecutionContext$Key;
389393
public final fun newBuilder ()Lcom/apollographql/apollo3/api/CustomScalarAdapters$Builder;
@@ -398,6 +402,7 @@ public final class com/apollographql/apollo3/api/CustomScalarAdapters$Builder {
398402
public final fun build ()Lcom/apollographql/apollo3/api/CustomScalarAdapters;
399403
public final fun clear ()V
400404
public final fun deferredFragmentIdentifiers (Ljava/util/Set;)Lcom/apollographql/apollo3/api/CustomScalarAdapters$Builder;
405+
public final fun errors (Ljava/util/List;)Lcom/apollographql/apollo3/api/CustomScalarAdapters$Builder;
401406
public final fun falseVariables (Ljava/util/Set;)Lcom/apollographql/apollo3/api/CustomScalarAdapters$Builder;
402407
}
403408

@@ -494,6 +499,7 @@ public final class com/apollographql/apollo3/api/Error$Location {
494499

495500
public abstract interface class com/apollographql/apollo3/api/Executable {
496501
public abstract fun adapter ()Lcom/apollographql/apollo3/api/Adapter;
502+
public abstract fun getIgnoreErrors ()Z
497503
public abstract fun rootField ()Lcom/apollographql/apollo3/api/CompiledField;
498504
public abstract fun serializeVariables (Lcom/apollographql/apollo3/api/json/JsonWriter;Lcom/apollographql/apollo3/api/CustomScalarAdapters;Z)V
499505
}
@@ -512,7 +518,8 @@ public final class com/apollographql/apollo3/api/Executables {
512518
public static final fun parseData (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/json/JsonReader;Lcom/apollographql/apollo3/api/CustomScalarAdapters;)Lcom/apollographql/apollo3/api/Executable$Data;
513519
public static final fun parseData (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/json/JsonReader;Lcom/apollographql/apollo3/api/CustomScalarAdapters;Ljava/util/Set;)Lcom/apollographql/apollo3/api/Executable$Data;
514520
public static final fun parseData (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/json/JsonReader;Lcom/apollographql/apollo3/api/CustomScalarAdapters;Ljava/util/Set;Ljava/util/Set;)Lcom/apollographql/apollo3/api/Executable$Data;
515-
public static synthetic fun parseData$default (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/json/JsonReader;Lcom/apollographql/apollo3/api/CustomScalarAdapters;Ljava/util/Set;Ljava/util/Set;ILjava/lang/Object;)Lcom/apollographql/apollo3/api/Executable$Data;
521+
public static final fun parseData (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/json/JsonReader;Lcom/apollographql/apollo3/api/CustomScalarAdapters;Ljava/util/Set;Ljava/util/Set;Ljava/util/List;)Lcom/apollographql/apollo3/api/Executable$Data;
522+
public static synthetic fun parseData$default (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/json/JsonReader;Lcom/apollographql/apollo3/api/CustomScalarAdapters;Ljava/util/Set;Ljava/util/Set;Ljava/util/List;ILjava/lang/Object;)Lcom/apollographql/apollo3/api/Executable$Data;
516523
public static final fun variables (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/CustomScalarAdapters;)Lcom/apollographql/apollo3/api/Executable$Variables;
517524
public static final fun variablesJson (Lcom/apollographql/apollo3/api/Executable;Lcom/apollographql/apollo3/api/CustomScalarAdapters;)Ljava/lang/String;
518525
}
@@ -574,6 +581,28 @@ public final class com/apollographql/apollo3/api/FakeResolverKt {
574581
public static final fun buildData (Lcom/apollographql/apollo3/api/BuilderFactory;Lkotlin/jvm/functions/Function1;Lcom/apollographql/apollo3/api/Adapter;Ljava/util/List;Ljava/lang/String;Lcom/apollographql/apollo3/api/FakeResolver;Lcom/apollographql/apollo3/api/CustomScalarAdapters;)Ljava/lang/Object;
575582
}
576583

584+
public abstract interface class com/apollographql/apollo3/api/FieldResult {
585+
}
586+
587+
public final class com/apollographql/apollo3/api/FieldResult$Failure : com/apollographql/apollo3/api/FieldResult {
588+
public fun <init> (Lcom/apollographql/apollo3/exception/ApolloException;)V
589+
public final fun getException ()Lcom/apollographql/apollo3/exception/ApolloException;
590+
}
591+
592+
public final class com/apollographql/apollo3/api/FieldResult$Success : com/apollographql/apollo3/api/FieldResult {
593+
public fun <init> (Ljava/lang/Object;)V
594+
public final fun getValue ()Ljava/lang/Object;
595+
}
596+
597+
public final class com/apollographql/apollo3/api/FieldResultKt {
598+
public static final fun exceptionOrNull (Lcom/apollographql/apollo3/api/FieldResult;)Ljava/lang/Exception;
599+
public static final fun getOrElse (Lcom/apollographql/apollo3/api/FieldResult;Ljava/lang/Object;)Ljava/lang/Object;
600+
public static final fun getOrNull (Lcom/apollographql/apollo3/api/FieldResult;)Ljava/lang/Object;
601+
public static final fun getOrThrow (Lcom/apollographql/apollo3/api/FieldResult;)Ljava/lang/Object;
602+
public static final fun graphQLErrorOrNull (Lcom/apollographql/apollo3/api/FieldResult;)Lcom/apollographql/apollo3/api/Error;
603+
public static final fun isSuccess (Lcom/apollographql/apollo3/api/FieldResult;)Z
604+
}
605+
577606
public final class com/apollographql/apollo3/api/FileUpload {
578607
public static final fun toUpload (Ljava/io/File;Ljava/lang/String;)Lcom/apollographql/apollo3/api/DefaultUpload;
579608
}
@@ -1174,7 +1203,9 @@ public final class com/apollographql/apollo3/exception/ApolloExceptionHandlerKt
11741203
}
11751204

11761205
public final class com/apollographql/apollo3/exception/ApolloGraphQLException : com/apollographql/apollo3/exception/ApolloException {
1206+
public fun <init> (Lcom/apollographql/apollo3/api/Error;)V
11771207
public fun <init> (Ljava/util/List;)V
1208+
public final fun getError ()Lcom/apollographql/apollo3/api/Error;
11781209
public final fun getErrors ()Ljava/util/List;
11791210
}
11801211

libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Adapters.kt

Lines changed: 85 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import com.apollographql.apollo3.api.json.MapJsonWriter
1111
import com.apollographql.apollo3.api.json.buildJsonString
1212
import com.apollographql.apollo3.api.json.readAny
1313
import com.apollographql.apollo3.api.json.writeAny
14+
import com.apollographql.apollo3.exception.ApolloException
15+
import com.apollographql.apollo3.exception.ApolloGraphQLException
1416
import kotlin.jvm.JvmField
1517
import kotlin.jvm.JvmName
1618
import kotlin.jvm.JvmOverloads
@@ -80,7 +82,7 @@ class OptionalAdapter<T>(private val wrappedAdapter: Adapter<T>) : Adapter<Optio
8082
}
8183

8284
/**
83-
* PresentAdapter can only express something that's present. Absent values are handled outside of the adapter.
85+
* PresentAdapter can only express something that's present. Absent values are handled outside the adapter.
8486
*
8587
* This adapter is used to handle optional arguments in operations and optional fields in Input objects.
8688
*/
@@ -118,9 +120,6 @@ class ApolloOptionalAdapter<T>(private val wrappedAdapter: Adapter<T>) : Adapter
118120
}
119121
}
120122

121-
@JvmName("-obj")
122-
fun <T> Adapter<T>.obj(buffered: Boolean = false) = ObjectAdapter(this, buffered)
123-
124123
@JvmField
125124
val StringAdapter = object : Adapter<String> {
126125
override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): String {
@@ -283,12 +282,6 @@ val ApolloOptionalBooleanAdapter = ApolloOptionalAdapter(BooleanAdapter)
283282
@JvmField
284283
val ApolloOptionalAnyAdapter = ApolloOptionalAdapter(AnyAdapter)
285284

286-
@JvmName("-nullable")
287-
fun <T : Any> Adapter<T>.nullable() = NullableAdapter(this)
288-
289-
@JvmName("-list")
290-
fun <T> Adapter<T>.list() = ListAdapter(this)
291-
292285
/**
293286
* Note that Arrays require their type to be known at compile time, so we construct an anonymous object with reference to
294287
* function with reified type parameters as a workaround.
@@ -297,7 +290,11 @@ fun <T> Adapter<T>.list() = ListAdapter(this)
297290
@JvmName("-array")
298291
inline fun <reified T> Adapter<T>.array() = object : Adapter<Array<T>> {
299292

300-
private inline fun <reified T> arrayFromJson(wrappedAdapter: Adapter<T>, reader: JsonReader, customScalarAdapters: CustomScalarAdapters): Array<T> {
293+
private inline fun <reified T> arrayFromJson(
294+
wrappedAdapter: Adapter<T>,
295+
reader: JsonReader,
296+
customScalarAdapters: CustomScalarAdapters,
297+
): Array<T> {
301298
reader.beginArray()
302299
val list = mutableListOf<T>()
303300
while (reader.hasNext()) {
@@ -311,7 +308,7 @@ inline fun <reified T> Adapter<T>.array() = object : Adapter<Array<T>> {
311308
wrappedAdapter: Adapter<T>,
312309
writer: JsonWriter,
313310
customScalarAdapters: CustomScalarAdapters,
314-
value: Array<T>
311+
value: Array<T>,
315312
) {
316313
writer.beginArray()
317314
value.forEach {
@@ -363,14 +360,14 @@ class ObjectAdapter<T>(
363360
}
364361
}
365362

366-
override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: T, ) {
363+
override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: T) {
367364
if (buffered && writer !is MapJsonWriter) {
368365
/**
369366
* Convert to a Map first
370367
*/
371368
val mapWriter = MapJsonWriter()
372369
mapWriter.beginObject()
373-
wrappedAdapter.toJson(mapWriter, customScalarAdapters, value, )
370+
wrappedAdapter.toJson(mapWriter, customScalarAdapters, value)
374371
mapWriter.endObject()
375372

376373
/**
@@ -379,8 +376,80 @@ class ObjectAdapter<T>(
379376
writer.writeAny(mapWriter.root()!!)
380377
} else {
381378
writer.beginObject()
382-
wrappedAdapter.toJson(writer, customScalarAdapters, value,)
379+
wrappedAdapter.toJson(writer, customScalarAdapters, value)
383380
writer.endObject()
384381
}
385382
}
386-
}
383+
}
384+
385+
private class ErrorAwareAdapter<T>(private val wrappedAdapter: Adapter<T>) : Adapter<T> {
386+
override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): T {
387+
if (reader.peek() == JsonReader.Token.NULL) {
388+
val error = customScalarAdapters.firstErrorStartingWith(reader.getPath())
389+
if (error != null) {
390+
reader.skipValue()
391+
throw ApolloGraphQLException(error)
392+
}
393+
}
394+
395+
return wrappedAdapter.fromJson(reader, customScalarAdapters)
396+
}
397+
398+
override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: T) {
399+
wrappedAdapter.toJson(writer, customScalarAdapters, value)
400+
}
401+
}
402+
403+
private class CatchToResultAdapter<T>(private val wrappedAdapter: Adapter<T>) : Adapter<FieldResult<T>> {
404+
override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): FieldResult<T> {
405+
return try {
406+
FieldResult.Success(wrappedAdapter.fromJson(reader, customScalarAdapters))
407+
} catch (e: ApolloException) {
408+
FieldResult.Failure(e)
409+
}
410+
}
411+
412+
override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: FieldResult<T>) {
413+
when (value) {
414+
is FieldResult.Success -> wrappedAdapter.toJson(writer, customScalarAdapters, value.getOrThrow())
415+
else -> Unit // ignore errors
416+
}
417+
}
418+
}
419+
420+
private class CatchToNullAdapter<T>(private val wrappedAdapter: Adapter<T>) : Adapter<@JvmSuppressWildcards T?> {
421+
override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): T? {
422+
return try {
423+
wrappedAdapter.fromJson(reader, customScalarAdapters)
424+
} catch (e: ApolloException) {
425+
null
426+
}
427+
}
428+
429+
override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: T?) {
430+
if (value == null) {
431+
// XXX: this potentially writes null instead of an error
432+
writer.nullValue()
433+
} else {
434+
wrappedAdapter.toJson(writer, customScalarAdapters, value)
435+
}
436+
}
437+
}
438+
439+
@JvmName("-nullable")
440+
fun <T : Any> Adapter<T>.nullable() = NullableAdapter(this)
441+
442+
@JvmName("-list")
443+
fun <T> Adapter<T>.list() = ListAdapter(this)
444+
445+
@JvmName("-obj")
446+
fun <T> Adapter<T>.obj(buffered: Boolean = false) = ObjectAdapter(this, buffered)
447+
448+
@JvmName("-catchToResult")
449+
fun <T> Adapter<T>.catchToResult(): Adapter<FieldResult<T>> = CatchToResultAdapter(this)
450+
451+
@JvmName("-errorAware")
452+
fun <T> Adapter<T>.errorAware(): Adapter<T> = ErrorAwareAdapter(this)
453+
454+
@JvmName("-catchToNull")
455+
fun <T> Adapter<T>.catchToNull(): Adapter<T?> = CatchToNullAdapter(this)

libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Assertions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import kotlin.jvm.JvmName
1313
*/
1414
fun checkFieldNotMissing(value: Any?, name: String) {
1515
if (value == null) {
16-
throw DefaultApolloException("Field '$name' is missing")
16+
throw DefaultApolloException("Field '$name' is missing or null")
1717
}
1818
}
1919

@@ -35,5 +35,5 @@ fun assertOneOf(vararg args: Optional<*>) {
3535
* Helper function for the Kotlin codegen
3636
*/
3737
fun missingField(jsonReader: JsonReader, name: String): Nothing {
38-
throw DefaultApolloException("Field '$name' is missing at path ${jsonReader.getPath()}")
38+
throw DefaultApolloException("Field '$name' is missing or null at path ${jsonReader.getPath()}")
3939
}

libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/CustomScalarAdapters.kt

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ class CustomScalarAdapters private constructor(
2222
*/
2323
@JvmField
2424
val deferredFragmentIdentifiers: Set<DeferredFragmentIdentifier>?,
25+
/**
26+
* Errors to use with @catch
27+
*/
28+
@JvmField
29+
val errors: List<Error>?,
30+
2531
private val unsafe: Boolean,
2632
) : ExecutionContext.Element {
2733

@@ -97,6 +103,26 @@ class CustomScalarAdapters private constructor(
97103
val PassThrough = Builder().unsafe(true).build()
98104
}
99105

106+
@ApolloExperimental
107+
fun firstErrorStartingWith(path: List<Any>): Error? {
108+
return errors?.firstOrNull {
109+
it.path?.startsWith(path) == true
110+
}
111+
}
112+
113+
private fun List<Any>.startsWith(responsePath: List<Any>): Boolean {
114+
// start at 1 to drop the `data.`
115+
for (i in 1.until(responsePath.size)) {
116+
if (i - 1 >= this.size) {
117+
return false
118+
}
119+
if (responsePath[i] != this[i - 1]) {
120+
return false
121+
}
122+
}
123+
return true
124+
}
125+
100126
fun newBuilder(): Builder {
101127
return Builder().addAll(this)
102128
.falseVariables(falseVariables)
@@ -108,6 +134,7 @@ class CustomScalarAdapters private constructor(
108134
private var unsafe = false
109135
private var falseVariables: Set<String>? = null
110136
private var deferredFragmentIdentifiers: Set<DeferredFragmentIdentifier>? = null
137+
private var errors: List<Error>? = null
111138

112139
fun falseVariables(falseVariables: Set<String>?) = apply {
113140
this.falseVariables = falseVariables
@@ -117,6 +144,10 @@ class CustomScalarAdapters private constructor(
117144
this.deferredFragmentIdentifiers = deferredFragmentIdentifiers
118145
}
119146

147+
fun errors(errors: List<Error>?) = apply {
148+
this.errors = errors
149+
}
150+
120151
fun <T> add(
121152
name: String,
122153
adapter: Adapter<T>,
@@ -148,8 +179,9 @@ class CustomScalarAdapters private constructor(
148179
fun build(): CustomScalarAdapters {
149180
return CustomScalarAdapters(
150181
adaptersMap,
151-
falseVariables ,
182+
falseVariables,
152183
deferredFragmentIdentifiers,
184+
errors,
153185
unsafe,
154186
)
155187
}

libraries/apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/Executable.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ interface Executable<D: Executable.Data> {
3030
*/
3131
fun rootField(): CompiledField
3232

33+
/**
34+
* A flag to disable error checking for the whole operation.
35+
* Used for backward compatibility.
36+
*/
37+
val ignoreErrors: Boolean
38+
3339
/**
3440
* Marker interface for generated models
3541
*/

0 commit comments

Comments
 (0)