Skip to content

Commit 4852dc8

Browse files
committed
adapt to breaking change in spring-graphql-1.4.0, fix test, add withOptions to sample
1 parent dcb0cca commit 4852dc8

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

sentry-samples/sentry-samples-spring-boot-jakarta/src/main/java/io/sentry/samples/spring/boot/jakarta/graphql/TaskCreatorController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public TaskCreatorController(final BatchLoaderRegistry batchLoaderRegistry) {
2020
// using mapped BatchLoader to not have to deal with correct ordering of items
2121
batchLoaderRegistry
2222
.forTypePair(String.class, ProjectController.Creator.class)
23+
.withOptions((builder) -> builder.setBatchingEnabled(true))
2324
.registerMappedBatchLoader(
2425
(Set<String> keys, BatchLoaderEnvironment env) -> {
2526
return Mono.fromCallable(

sentry-spring-jakarta/src/main/java/io/sentry/spring/jakarta/graphql/SentryBatchLoaderRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public BatchLoaderRegistry.RegistrationSpec<K, V> withName(String name) {
7676

7777
@Override
7878
public BatchLoaderRegistry.RegistrationSpec<K, V> withOptions(
79-
Consumer<DataLoaderOptions> optionsConsumer) {
79+
Consumer<DataLoaderOptions.Builder> optionsConsumer) {
8080
return delegate.withOptions(optionsConsumer);
8181
}
8282

sentry-spring-jakarta/src/test/kotlin/io/sentry/spring/jakarta/graphql/SentrySpringSubscriptionHandlerTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
package io.sentry.spring.graphql
1+
package io.sentry.spring.jakarta.graphql
22

33
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters
44
import graphql.language.Document
55
import graphql.language.OperationDefinition
66
import graphql.schema.DataFetchingEnvironment
77
import io.sentry.IScopes
88
import io.sentry.graphql.ExceptionReporter
9-
import io.sentry.spring.jakarta.graphql.SentrySpringSubscriptionHandler
109
import org.junit.jupiter.api.assertThrows
1110
import org.mockito.kotlin.anyOrNull
11+
import org.mockito.kotlin.check
1212
import org.mockito.kotlin.mock
1313
import org.mockito.kotlin.same
1414
import org.mockito.kotlin.verify
@@ -40,10 +40,10 @@ class SentrySpringSubscriptionHandlerTest {
4040

4141
verify(exceptionReporter).captureThrowable(
4242
same(exception),
43-
org.mockito.kotlin.check {
43+
check {
4444
assertEquals(true, it.isSubscription)
4545
assertSame(scopes, it.scopes)
46-
assertEquals("query testQuery\n", it.query)
46+
assertEquals("query testQuery \n", it.query)
4747
},
4848
anyOrNull()
4949
)
@@ -69,10 +69,10 @@ class SentrySpringSubscriptionHandlerTest {
6969

7070
verify(exceptionReporter).captureThrowable(
7171
same(exception),
72-
org.mockito.kotlin.check {
72+
check {
7373
assertEquals(true, it.isSubscription)
7474
assertSame(scopes, it.scopes)
75-
assertEquals("query testQuery\n", it.query)
75+
assertEquals("query testQuery \n", it.query)
7676
},
7777
anyOrNull()
7878
)

0 commit comments

Comments
 (0)