Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 23.11.0 #28

Merged
merged 9 commits into from
Nov 9, 2023
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
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ root = true
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
charset = utf-8
max_line_length = 120
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
check-lilo:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B -ntp package

- name: Format Check
run: mvn -B -ntp com.spotify.fmt:fmt-maven-plugin:2.21.1:check

check-lilo-samples:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build lilo and cache
run: mvn -B -ntp clean install -DskipTests=true -Dgpg.skip -Dcheckstyle.skip -Denforcer.skip -Dmaven.javadoc.skip -Dmaven.source.skip

- name: Check lilo samples
run: cd lilo-samples && mvn -B -ntp compile com.spotify.fmt:fmt-maven-plugin:2.21.1:check
24 changes: 0 additions & 24 deletions .github/workflows/pr-check.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Lilo
# Lilo [![Build Status](https://github.com/friatech/lilo/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/friatech/lilo/actions/workflows/ci.yml?query=branch%3Amain) [![Latest Release](https://img.shields.io/maven-central/v/io.fria/lilo?versionPrefix=23.)](https://maven-badges.herokuapp.com/maven-central/io.fria/lilo/) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

![Lilo and Stitch](resources/lilo-and-stitch.webp)

**Lilo** is a super-fast GraphQL stitching library. Project is heavily inspired by [Atlassian Braid](https://bitbucket.org/atlassian/graphql-braid).
**Lilo** focus on simplicity. You can find plenty of samples in the codebase and we aim to add more and more in every release.
Please do not forget to check `/lilo-samples` directory for more sample project.
**Lilo** is a super-fast GraphQL stitching library. The project is heavily inspired by [Atlassian Braid](https://bitbucket.org/atlassian/graphql-braid).
**Lilo** focuses on simplicity and easy to use. You can find plenty of samples in the codebase and we aim to add more and more in every release.
Please do not forget to check `/lilo-samples` directory for more sample projecta.

## Installation

Expand All @@ -16,7 +16,7 @@ Just add a single **Lilo** dependency to your `pom.xml` file.
<dependency>
<groupId>io.fria</groupId>
<artifactId>lilo</artifactId>
<version>23.7.0</version>
<version>23.11.0</version>
</dependency>
...
</dependencies>
Expand All @@ -25,13 +25,13 @@ Just add a single **Lilo** dependency to your `pom.xml` file.
If you're using gradle add the dependency to your `build.gradle` file.

```groovy
implementation 'io.fria:lilo:23.6.0'
implementation 'io.fria:lilo:23.11.0'
```

## Basic Usage

Here is the story, Alice has 2 graphql microservices and she wants to make her gateway to dispatch
the graphql requests to their respective microservices. `Microservice A` provides a GraphQL query for user listing,
Here is the story, Alice has 2 GraphQL microservices and she wants to make her gateway to dispatch
the GraphQL requests to their respective microservices. `Microservice A` provides a GraphQL query for user listing,
and `Microservice B` provides a GraphQL mutation for user creation. So Alice can use both query and mutation via
just sending requests to the `Gateway` directly. **Lilo** stitches the GraphQL schemas and provides a combined schema.

Expand Down Expand Up @@ -59,11 +59,11 @@ final Lilo lilo = Lilo.builder()
.build();
```

But for complete working example you need to serve the stitching logic from a graphql endpoint. (Probably `/graphql`)
But for a complete working example you need to serve the stitching logic from a GraphQL endpoint. (Probably `/graphql`)
Please examine the `01-spring-boot-hello-world` example in `lilo-samples` folder.

In most cases, we need an authentication or some sort of header manipulation. In that case, creating a custom
introspection and query retrievers might help us to modify outgoing requests or incoming responses. Following
In most cases, we need an authentication or some sort of header manipulation. In that case, creating custom
introspection and query retrievers might help us to modify outgoing requests or incoming responses. The following
example shows a very basic example for custom retrievers.

```java
Expand All @@ -83,7 +83,7 @@ example shows a very basic example for custom retrievers.
)
```

For further details you can examine the `02-spring-boot-basic-stitching` example in `lilo-samples` folder.
For further details, you can examine the `02-spring-boot-basic-stitching` example in `lilo-samples` folder.

If Gateway distributes the messages to `Microservice A` and also contains an embedded schema then the architecture might
be something like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
14 changes: 11 additions & 3 deletions lilo-samples/01-spring-boot-hello-world/lilo-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.8</version>
<version>3.0.12</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>

<dependency>
Expand All @@ -67,7 +67,7 @@
<dependency>
<groupId>io.fria</groupId>
<artifactId>lilo</artifactId>
<version>23.7.0</version>
<version>23.11.0</version>
</dependency>
</dependencies>

Expand All @@ -77,6 +77,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<configLocation>../../../config/checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
19 changes: 18 additions & 1 deletion lilo-samples/01-spring-boot-hello-world/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.fria.lilo.samples.spring-boot-hello-world</groupId>
<artifactId>spring-boot-hello-world-parent</artifactId>
<version>23.7.0</version>
<version>23.11.0</version>
<packaging>pom</packaging>

<name>01-spring-boot-hello-world</name>
Expand Down Expand Up @@ -34,9 +34,26 @@
</developer>
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<modules>
<module>lilo-gateway</module>
<module>server1</module>
<module>server2</module>
</modules>

<build>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<configLocation>../../config/checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 10 additions & 2 deletions lilo-samples/01-spring-boot-hello-world/server1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.8</version>
<version>3.0.12</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>

<dependency>
Expand All @@ -76,6 +76,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<configLocation>../../../config/checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 10 additions & 2 deletions lilo-samples/01-spring-boot-hello-world/server2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.8</version>
<version>3.0.12</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>

<dependency>
Expand All @@ -76,6 +76,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<configLocation>../../../config/checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
34 changes: 11 additions & 23 deletions lilo-samples/02-spring-boot-basic-stitching/lilo-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.8</version>
<version>3.0.12</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -39,20 +39,6 @@
</developer>
</developers>

<repositories>
<repository>
<id>central</id>
<name>maven central</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>

<repository>
<id>maven-atlassian-com</id>
<name>Atlassian Public Repository</name>
<url>https://packages.atlassian.com/maven/public</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -69,7 +55,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>

<dependency>
Expand All @@ -81,13 +67,7 @@
<dependency>
<groupId>io.fria</groupId>
<artifactId>lilo</artifactId>
<version>23.7.0</version>
</dependency>

<dependency>
<groupId>com.atlassian.braid</groupId>
<artifactId>graphql-braid</artifactId>
<version>0.23.15</version>
<version>23.11.0</version>
</dependency>
</dependencies>

Expand All @@ -97,6 +77,14 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<configLocation>../../../config/checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading