Skip to content

Commit

Permalink
Release 23.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
firatkucuk committed Dec 27, 2023
1 parent e760d59 commit 98f0177
Show file tree
Hide file tree
Showing 35 changed files with 114 additions and 70 deletions.
18 changes: 10 additions & 8 deletions lilo-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.fria</groupId>
<artifactId>lilo-spring</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>23.12.1</version>

<name>lilo-spring</name>
<description>Lilo GraphQL stitching library Spring Bindings</description>
Expand Down Expand Up @@ -42,14 +42,16 @@
<maven.min.version>3.6.3</maven.min.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Check the spring boot documentation -->
<!-- https://docs.spring.io/spring-boot/docs/current/reference/html/dependency-versions.html -->
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<spring.version>6.1.1</spring.version>
<spring-boot.version>3.2.0</spring-boot.version>
<lilo.version>23.12.1</lilo.version>
<spring.version>6.1.2</spring.version>
<spring-boot.version>3.2.1</spring-boot.version>
<jakarta-servlet.version>6.0.0</jakarta-servlet.version>
<!-- Plugin Versions -->
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.2.3</maven-surefire-plugin.version>
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
Expand All @@ -60,8 +62,8 @@
<apache-rat-plugin.version>0.15</apache-rat-plugin.version>
<!-- Plugin Dependency Versions -->
<error-prone.version>2.23.0</error-prone.version>
<checkstyle.version>10.12.5</checkstyle.version>
<spotbugs.version>4.8.2</spotbugs.version>
<checkstyle.version>10.12.6</checkstyle.version>
<spotbugs.version>4.8.3</spotbugs.version>
</properties>

<dependencies>
Expand Down
14 changes: 7 additions & 7 deletions lilo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.fria</groupId>
<artifactId>lilo</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>23.12.1</version>

<name>lilo</name>
<description>Lilo GraphQL stitching library</description>
Expand Down Expand Up @@ -44,15 +44,15 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<graphql-java.version>21.3</graphql-java.version>
<jackson-databind.version>2.16.0</jackson-databind.version>
<reactor-core.version>3.6.0</reactor-core.version>
<jackson-databind.version>2.16.1</jackson-databind.version>
<reactor-core.version>3.6.1</reactor-core.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<junit-jupiter.version>5.10.1</junit-jupiter.version>
<mockito.version>5.8.0</mockito.version>
<slf4j.version>2.0.9</slf4j.version>
<!-- Plugin Versions -->
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.2.3</maven-surefire-plugin.version>
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
Expand All @@ -63,8 +63,8 @@
<apache-rat-plugin.version>0.15</apache-rat-plugin.version>
<!-- Plugin Dependency Versions -->
<error-prone.version>2.23.0</error-prone.version>
<checkstyle.version>10.12.5</checkstyle.version>
<spotbugs.version>4.8.2</spotbugs.version>
<checkstyle.version>10.12.6</checkstyle.version>
<spotbugs.version>4.8.3</spotbugs.version>
</properties>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions lilo/src/main/java/io/fria/lilo/GraphQLResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import graphql.ExecutionResult;
import graphql.ExecutionResultImpl;
import graphql.GraphQLError;
import io.fria.lilo.error.LiloGraphQLError;
import io.fria.lilo.error.GraphQLResultError;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
Expand All @@ -28,7 +28,7 @@
final class GraphQLResult implements ExecutionResult {

private Map<String, Object> data;
private List<LiloGraphQLError> errors;
private List<GraphQLResultError> errors;
private Map<Object, Object> extensions;

@Override
Expand Down
4 changes: 2 additions & 2 deletions lilo/src/main/java/io/fria/lilo/Lilo.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import graphql.ExecutionResult;
import graphql.execution.DataFetcherExceptionHandler;
import graphql.execution.instrumentation.Instrumentation;
import io.fria.lilo.error.SourceDataFetcherExceptionHandler;
import io.fria.lilo.error.LiloDefaultDataFetcherExceptionHandler;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -75,7 +75,7 @@ public static final class LiloBuilder {

private final Map<String, SchemaSource> schemaSources = new HashMap<>();
private DataFetcherExceptionHandler dataFetcherExceptionHandler =
new SourceDataFetcherExceptionHandler();
new LiloDefaultDataFetcherExceptionHandler();
private IntrospectionFetchingMode introspectionFetchingMode =
IntrospectionFetchingMode.CACHE_UNTIL_INVALIDATION;
private boolean retrySchemaLoad = true;
Expand Down
8 changes: 4 additions & 4 deletions lilo/src/main/java/io/fria/lilo/RemoteSchemaSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import graphql.schema.idl.SchemaParser;
import graphql.schema.idl.TypeDefinitionRegistry;
import graphql.schema.idl.TypeRuntimeWiring;
import io.fria.lilo.error.InvalidLiloConfigException;
import io.fria.lilo.error.SourceDataFetcherException;
import io.fria.lilo.error.LiloInvalidConfigException;
import io.fria.lilo.error.LiloSourceDataFetcherException;
import io.fria.lilo.subscription.SubscriptionRetriever;
import io.fria.lilo.subscription.SubscriptionSourcePublisher;
import java.util.List;
Expand Down Expand Up @@ -120,7 +120,7 @@ private RemoteSchemaSource(
final List<GraphQLError> errors = graphQLResult.getErrors();

if (errors != null && !errors.isEmpty()) {
throw new SourceDataFetcherException(errors);
throw new LiloSourceDataFetcherException(errors);
}

return ((Map<String, Object>) graphQLResult.getData()).values().iterator().next();
Expand Down Expand Up @@ -288,7 +288,7 @@ private RemoteSchemaSource(

return publisher;
} else {
throw new InvalidLiloConfigException("There's no defined SubscriptionRetriever");
throw new LiloInvalidConfigException("There's no defined SubscriptionRetriever");
}
} else {
return this.fetchData(query, liloContext, localContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* When a @{@link GraphQLResultError} is created, this class pinpoints the location of the error in
* query source
*/
public class ErrorSourceLocation extends SourceLocation {

public ErrorSourceLocation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class LiloGraphQLError implements GraphQLError {
/** This is a POJO class which includes GraphQL error definitions */
public class GraphQLResultError implements GraphQLError {

private String message;
private List<ErrorSourceLocation> locations;
Expand All @@ -35,7 +36,7 @@ public class LiloGraphQLError implements GraphQLError {
private Map<String, Object> extensions;

@SuppressWarnings("checkstyle:WhitespaceAround")
public LiloGraphQLError() {}
public GraphQLResultError() {}

@Override
public @Nullable ErrorClassification getErrorType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,23 @@
import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.NotNull;

public class SourceDataFetcherExceptionHandler extends SimpleDataFetcherExceptionHandler {
/**
* This is the default exception handler provided by Lilo. It can be overridden via @{@link
* io.fria.lilo.Lilo.LiloBuilder#defaultDataFetcherExceptionHandler} method.
*/
public class LiloDefaultDataFetcherExceptionHandler extends SimpleDataFetcherExceptionHandler {

@Override
public @NotNull CompletableFuture<DataFetcherExceptionHandlerResult> handleException(
final @NotNull DataFetcherExceptionHandlerParameters handlerParameters) {

final Throwable exception = handlerParameters.getException();

if (exception instanceof SourceDataFetcherException) {
if (exception instanceof LiloSourceDataFetcherException) {

final DataFetcherExceptionHandlerResult result =
DataFetcherExceptionHandlerResult.newResult()
.errors((List<GraphQLError>) ((SourceDataFetcherException) exception).getErrors())
.errors((List<GraphQLError>) ((LiloSourceDataFetcherException) exception).getErrors())
.build();

return CompletableFuture.completedFuture(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
*/
package io.fria.lilo.error;

import org.jetbrains.annotations.NotNull;

public class InvalidLiloConfigException extends RuntimeException {

public InvalidLiloConfigException(final @NotNull String message) {
super(message);
}
/** Marker interface for all Lilo exceptions */
public interface LiloException {
// Marker interface
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.fria.lilo.error;

import org.jetbrains.annotations.NotNull;

/**
* Fires when configuration and usage mismatches, like when a subscription query used without a
* defined subscription retriever.
*/
public class LiloInvalidConfigException extends RuntimeException implements LiloException {

/**
* Constructs the exception class
*
* @param message Message of the exception
*/
public LiloInvalidConfigException(final @NotNull String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class SourceDataFetcherException extends GraphQLException {
/**
* It is fired when a data fetcher catches errors as a returned result from remote schema source.
*/
public class LiloSourceDataFetcherException extends GraphQLException implements LiloException {

private final List<? extends GraphQLError> errors;

public SourceDataFetcherException(final @NotNull List<? extends GraphQLError> errors) {
public LiloSourceDataFetcherException(final @NotNull List<? extends GraphQLError> errors) {
super(extractMessage(Objects.requireNonNull(errors)));
this.errors = errors;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.fria</groupId>
<artifactId>lilo-parent</artifactId>
<version>23.12.1-SNAPSHOT</version>
<version>23.12.1</version>
<packaging>pom</packaging>

<name>lilo-parent</name>
Expand Down
2 changes: 1 addition & 1 deletion samples/lilo-spring/01-subscription/lilo-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
2 changes: 1 addition & 1 deletion samples/lilo-spring/01-subscription/server1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
2 changes: 1 addition & 1 deletion samples/lilo-spring/01-subscription/server2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
8 changes: 4 additions & 4 deletions samples/lilo-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Plugin Versions -->
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.2.3</maven-surefire-plugin.version>
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
<spotbugs-maven-plugin.version>4.8.2.0</spotbugs-maven-plugin.version>
<fmt-maven-plugin.version>2.21.1</fmt-maven-plugin.version>
<!-- Plugin Dependency Versions -->
<error-prone.version>2.23.0</error-prone.version>
<checkstyle.version>10.12.5</checkstyle.version>
<spotbugs.version>4.8.2</spotbugs.version>
<checkstyle.version>10.12.6</checkstyle.version>
<spotbugs.version>4.8.3</spotbugs.version>
</properties>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
2 changes: 1 addition & 1 deletion samples/lilo/01-spring-boot-hello-world/server1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
2 changes: 1 addition & 1 deletion samples/lilo/01-spring-boot-hello-world/server2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Dependency Versions -->
<lilo.version>23.12.1-SNAPSHOT</lilo.version>
<lilo.version>23.12.1</lilo.version>
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<!-- Plugin Versions -->
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
Expand Down
Loading

0 comments on commit 98f0177

Please sign in to comment.