diff --git a/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailure.kt b/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailure.kt index 155e17f729..b7709e55d2 100644 --- a/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailure.kt +++ b/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailure.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019 Expedia, Inc + * Copyright 2024 Expedia, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ class FederatedRequestFailure(private val errorMessage: String, private val erro override fun getErrorType(): ErrorClassification = ErrorType.DataFetchingException - override fun getLocations(): List = listOf(SourceLocation(-1, -1)) + override fun getLocations(): List? = null override fun getExtensions(): Map? = if (error != null) { diff --git a/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/InvalidFederatedRequest.kt b/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/InvalidFederatedRequest.kt index ab7ff0eff7..681a48bf07 100644 --- a/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/InvalidFederatedRequest.kt +++ b/generator/graphql-kotlin-federation/src/main/kotlin/com/expediagroup/graphql/generator/federation/exception/InvalidFederatedRequest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019 Expedia, Inc + * Copyright 2024 Expedia, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,5 +29,5 @@ class InvalidFederatedRequest(private val errorMessage: String) : GraphQLError { override fun getErrorType(): ErrorClassification = ErrorType.ValidationError - override fun getLocations(): List = listOf(SourceLocation(-1, -1)) + override fun getLocations(): List? = null } diff --git a/generator/graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailureTest.kt b/generator/graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailureTest.kt index e4b3918ffd..3c9088da56 100644 --- a/generator/graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailureTest.kt +++ b/generator/graphql-kotlin-federation/src/test/kotlin/com/expediagroup/graphql/generator/federation/exception/FederatedRequestFailureTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019 Expedia, Inc + * Copyright 2024 Expedia, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.expediagroup.graphql.generator.federation.exception import graphql.ErrorType -import graphql.language.SourceLocation import org.junit.jupiter.api.Test import kotlin.test.assertEquals import kotlin.test.assertNull @@ -38,7 +37,7 @@ internal class FederatedRequestFailureTest { @Test fun getLocations() { - assertEquals(expected = listOf(SourceLocation(-1, -1)), actual = simpleFailure.locations) + assertNull(simpleFailure.locations) } @Test