Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -29,7 +29,7 @@ class FederatedRequestFailure(private val errorMessage: String, private val erro

override fun getErrorType(): ErrorClassification = ErrorType.DataFetchingException

override fun getLocations(): List<SourceLocation> = listOf(SourceLocation(-1, -1))
override fun getLocations(): List<SourceLocation>? = null

override fun getExtensions(): Map<String, Any>? =
if (error != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -29,5 +29,5 @@ class InvalidFederatedRequest(private val errorMessage: String) : GraphQLError {

override fun getErrorType(): ErrorClassification = ErrorType.ValidationError

override fun getLocations(): List<SourceLocation> = listOf(SourceLocation(-1, -1))
override fun getLocations(): List<SourceLocation>? = null
}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand All @@ -38,7 +37,7 @@ internal class FederatedRequestFailureTest {

@Test
fun getLocations() {
assertEquals(expected = listOf(SourceLocation(-1, -1)), actual = simpleFailure.locations)
assertNull(simpleFailure.locations)
}

@Test
Expand Down