Skip to content

Add support for GraphQL @deprecated directive #10

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

Merged
merged 71 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
18cf448
[Automated] Update the native jar versions
zetcco Jan 17, 2024
abfe552
[Automated] Update the native jar versions
zetcco Jan 17, 2024
c394e4d
[Automated] Update the native jar versions
zetcco Jan 17, 2024
9cfdd5d
[Automated] Update the native jar versions
zetcco Jan 17, 2024
9098007
[Automated] Update the native jar versions
zetcco Jan 17, 2024
0ed7720
[Automated] Update the native jar versions
zetcco Jan 17, 2024
6862fca
Bump Java version from 11 to 17
zetcco Jan 17, 2024
7dd4288
[Automated] Update the native jar versions
zetcco Jan 29, 2024
081c8e9
Version bump
zetcco Jan 31, 2024
f758495
Update Jballerina jvm target to Java 17
zetcco Feb 2, 2024
b8cfdab
Skip readonly output directory negative test
zetcco Feb 2, 2024
35f6cc4
[Automated] Update the native jar versions
zetcco Feb 2, 2024
7979e05
[Automated] Update the native jar versions
zetcco Feb 2, 2024
9787bbf
Add checkstyleTest explicit dependency on checkstyle
zetcco Feb 2, 2024
e0b0343
Change CRLF to LF
zetcco Feb 2, 2024
9fb33b0
Fix code generation test fail due to EOL differences
zetcco Feb 2, 2024
480437a
Fix spotbugs warning
zetcco Feb 2, 2024
ef176d8
Update README.md
zetcco Feb 3, 2024
2139ef8
[Automated] Update the native jar versions
zetcco Feb 5, 2024
13a3b21
Add `@deprecated` directive support
zetcco Feb 6, 2024
ab1da27
Add support to generate bal deprecation documentation for gql `@depre…
zetcco Feb 7, 2024
7287829
Update workflow files
zetcco May 3, 2024
c0b2545
Change line ending to LF
zetcco May 3, 2024
b427d66
Remove push actions in workflow
zetcco May 3, 2024
cb4c0c3
Update PR workflow
zetcco May 3, 2024
86e288b
Update PR workflow
zetcco May 3, 2024
55e2dc2
Added gitattributes
zetcco May 7, 2024
b5cdb9a
Update PR workflow
zetcco May 7, 2024
72d6623
Generate service source code with `toSourceCode()` on `Formatter`
zetcco May 7, 2024
668b859
[Automated] Update the native jar versions
zetcco May 7, 2024
d47a568
Update PR workflow
zetcco May 7, 2024
2ddec77
Update gitattributes
zetcco May 7, 2024
56b5a1d
[Automated] Update the native jar versions
zetcco May 10, 2024
f3e2dd6
Bump ballerina version to `2201.9.0`
zetcco May 10, 2024
4940e8c
Update license header
zetcco May 10, 2024
a503b7b
[Automated] Update the native jar versions
zetcco May 19, 2024
d9d0cc4
[Automated] Update the native jar versions
zetcco May 19, 2024
031031e
[Automated] Update the native jar versions
zetcco May 19, 2024
9966652
[Automated] Update the native jar versions
zetcco May 19, 2024
7149e5a
[Automated] Update the native jar versions
zetcco May 19, 2024
fc3e61d
[Automated] Update the native jar versions
zetcco May 19, 2024
d0688aa
[Automated] Update the native jar versions
zetcco May 19, 2024
33b860b
[Automated] Update the native jar versions
zetcco May 19, 2024
716e046
[Automated] Update the native jar versions
zetcco May 19, 2024
6cfbf75
[Automated] Update the native jar versions
zetcco May 19, 2024
af6160c
[Automated] Update the native jar versions
zetcco May 19, 2024
e306289
[Automated] Update the native jar versions
zetcco May 19, 2024
6445bfe
[Automated] Update the native jar versions
zetcco May 19, 2024
2e7ea91
[Automated] Update the native jar versions
zetcco May 19, 2024
316f838
[Automated] Update the native jar versions
zetcco May 19, 2024
0daabe6
[Automated] Update the native jar versions
zetcco May 19, 2024
fa38c72
[Automated] Update the native jar versions
zetcco May 19, 2024
9245ccd
[Automated] Update the native jar versions
zetcco May 19, 2024
2fd3942
[Automated] Update the native jar versions
zetcco May 19, 2024
84ea830
[Automated] Update the native jar versions
zetcco May 19, 2024
4d51bcd
[Automated] Update the native jar versions
zetcco May 20, 2024
648f5f1
[Automated] Update the native jar versions
zetcco May 20, 2024
33d47cd
Fix gradle invalid path due to whitespace
zetcco Jun 7, 2024
cacf1f4
[Automated] Update the native jar versions
zetcco Jun 7, 2024
9cc7b40
[Automated] Update the native jar versions
zetcco Jun 7, 2024
6edfe4f
[Automated] Update the native jar versions
zetcco Jun 7, 2024
7329d74
[Automated] Update the native jar versions
zetcco Jun 7, 2024
b74e577
[Automated] Update the native jar versions
zetcco Jun 7, 2024
4f40217
[Automated] Update the native jar versions
zetcco Jun 7, 2024
40389b6
[Automated] Update the native jar versions
zetcco Jun 7, 2024
e558cf2
[Automated] Update the native jar versions
zetcco Jun 7, 2024
1b74e21
[Automated] Update the native jar versions
zetcco Jun 7, 2024
0cf4d32
[Automated] Update the native jar versions
zetcco Jun 7, 2024
71a1779
[Automated] Update the native jar versions
zetcco Jun 7, 2024
53464a5
[Automated] Update the native jar versions
zetcco Jun 8, 2024
3cac94b
Downgrade ballerina version to 2201.8.6
zetcco Jun 9, 2024
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
190 changes: 95 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,95 @@
# GraphQL Federation Gateway
[![Build](https://github.com/Ishad-M-I-M/graphql-federation-gateway/actions/workflows/pull_request.yml/badge.svg)](https://github.com/Ishad-M-I-M/graphql-federation-gateway/actions/workflows/pull_request.yml/badge.svg)
[![codecov](https://codecov.io/gh/Ishad-M-I-M/graphql-federation-gateway/branch/main/graph/badge.svg?token=hLnziNmccQ)](https://codecov.io/gh/Ishad-M-I-M/graphql-federation-gateway)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/Ishad-M-I-M/graphql-federation-gateway.svg)](https://github.com/Ishad-M-I-M/graphql-federation-gateway/commits/master)
[![Github issues](https://img.shields.io/github/issues/Ishad-M-I-M/graphql-federation-gateway.svg?label=Open%20Issues)](https://github.com/Ishad-M-I-M/graphql-federation-gateway)

A Graphql Federation Gateway implemented using Ballerina as the underline technology.
This will generate a gateway executable for a given supergraph schema.

## Using the Gateway

### Prerequisites
1. Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).

- [Oracle](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)

- [OpenJDK](https://adoptopenjdk.net/)

> **Note:** Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.

2. Download and install [Ballerina](https://ballerina.io/downloads/)

### Steps to use the gateway.
1. Download [gateway.sh](https://github.com/Ishad-M-I-M/graphql-federation-gateway/releases/download/v0.1.0/gateway.sh)

2. To start the gateway run the following command in the terminal.

```bash
./gateway.sh -s <supergraphPath> -p <port>
```

- `supergraphPath` is a mandatory argument.
- If the port is not provided the default port `9090` will be used.

### Try out the example
1. Navigate into `examples/astronauts_missions_example` directory. There's two federated graphql services and a supergraph schema.
2. In terminal execute `./gateway.sh -s supergraph.graphql` to start the gateway.
3. In terminal execute `bal run` inside both `astronauts_service` and `missions_service` directories to start the subgraph services.
3. Navigate into `astronuats_service` directory and execute `bal run` in the terminal to start the `astronauts_service` subgraph service.
4. Navigate into `missions_service` directory and execute `bal run` in the terminal to start the `missions_service` subgraph service.
5. Try out the following query in the graphql client.

```graphql
query {
astronauts {
id
name
missions {
id
designation
}
}
}
```

## Build from the source.

### Setup the prerequisites
1. Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).

- [Oracle](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)

- [OpenJDK](https://adoptopenjdk.net/)

> **Note:** Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.

2. Export your Github personal access token with the read package permissions as follows.

export packageUser=<Username>
export packagePAT=<Personal access token>

### Build the source

Execute the commands below to build from the source.
> **Note:** When running the build with test in Windows use `-Pdisable=invalid-permission` to skip the Windows incompatible test cases.

1. To build the project:
```bash
./gradlew clean build
```

2. To run the tests
```bash
./gradlew clean test
```

3. To build the project without tests:
```bash
./gradlew clean build -x test
```

4. Publish `jar` artifact to the local `.m2` repository:
```bash
./gradlew clean build publishToMavenLocal
```
# GraphQL Federation Gateway
[![Build](https://github.com/Ishad-M-I-M/graphql-federation-gateway/actions/workflows/pull_request.yml/badge.svg)](https://github.com/Ishad-M-I-M/graphql-federation-gateway/actions/workflows/pull_request.yml/badge.svg)
[![codecov](https://codecov.io/gh/Ishad-M-I-M/graphql-federation-gateway/branch/main/graph/badge.svg?token=hLnziNmccQ)](https://codecov.io/gh/Ishad-M-I-M/graphql-federation-gateway)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/Ishad-M-I-M/graphql-federation-gateway.svg)](https://github.com/Ishad-M-I-M/graphql-federation-gateway/commits/master)
[![Github issues](https://img.shields.io/github/issues/Ishad-M-I-M/graphql-federation-gateway.svg?label=Open%20Issues)](https://github.com/Ishad-M-I-M/graphql-federation-gateway)
A Graphql Federation Gateway implemented using Ballerina as the underline technology.
This will generate a gateway executable for a given supergraph schema.
## Using the Gateway
### Prerequisites
1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
- [Oracle](https://www.oracle.com/java/technologies/downloads/#java17)
- [OpenJDK](https://adoptopenjdk.net/)
> **Note:** Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.
2. Download and install [Ballerina](https://ballerina.io/downloads/)
### Steps to use the gateway.
1. Download [gateway.sh](https://github.com/Ishad-M-I-M/graphql-federation-gateway/releases/download/v0.1.0/gateway.sh)
2. To start the gateway run the following command in the terminal.
```bash
./gateway.sh -s <supergraphPath> -p <port>
```
- `supergraphPath` is a mandatory argument.
- If the port is not provided the default port `9090` will be used.
### Try out the example
1. Navigate into `examples/astronauts_missions_example` directory. There's two federated graphql services and a supergraph schema.
2. In terminal execute `./gateway.sh -s supergraph.graphql` to start the gateway.
3. In terminal execute `bal run` inside both `astronauts_service` and `missions_service` directories to start the subgraph services.
3. Navigate into `astronuats_service` directory and execute `bal run` in the terminal to start the `astronauts_service` subgraph service.
4. Navigate into `missions_service` directory and execute `bal run` in the terminal to start the `missions_service` subgraph service.
5. Try out the following query in the graphql client.
```graphql
query {
astronauts {
id
name
missions {
id
designation
}
}
}
```
## Build from the source.
### Setup the prerequisites
1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
- [Oracle](https://www.oracle.com/java/technologies/downloads/#java17)
- [OpenJDK](https://adoptopenjdk.net/)
> **Note:** Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.
2. Export your Github personal access token with the read package permissions as follows.
export packageUser=<Username>
export packagePAT=<Personal access token>
### Build the source
Execute the commands below to build from the source.
> **Note:** When running the build with test in Windows use `-Pdisable=invalid-permission` to skip the Windows incompatible test cases.
1. To build the project:
```bash
./gradlew clean build
```
2. To run the tests
```bash
./gradlew clean test
```
3. To build the project without tests:
```bash
./gradlew clean build -x test
```
4. Publish `jar` artifact to the local `.m2` repository:
```bash
./gradlew clean build publishToMavenLocal
```
30 changes: 15 additions & 15 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ export=["graphql_federation_gateway"]
keywords = ["graphql", "federation", "gateway"]
repository = "https://github.com/xlibb/graphql-federation-gateway"
license = ["Apache-2.0"]
distribution = "2201.7.0"
distribution = "2201.8.4"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.xlibb.gateway"
artifactId = "gateway-native"
version = "0.1.0"
path = "../native/build/libs/gateway-native-0.1.0-SNAPSHOT.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.graphql-java"
artifactId = "graphql-java"
version = "20.0"
path="./lib/graphql-java-20.0.jar"
version = "20.6"
path="./lib/graphql-java-20.6.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.graphql-java"
artifactId = "graphql-java-extended-scalars"
version = "20.0"
path="./lib/graphql-java-extended-scalars-20.0.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "commons-io"
artifactId = "commons-io"
version = "2.11.0"
path="./lib/commons-io-2.11.0.jar"
version = "2.12.0"
path="./lib/commons-io-2.12.0.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "org.ballerinalang"
artifactId = "formatter-core"
version = "2201.7.0"
path="./lib/formatter-core-2201.7.0.jar"
version = "2201.8.4"
path="./lib/formatter-core-2201.8.4.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "org.ballerinalang"
artifactId = "ballerina-parser"
version = "2201.7.0"
path="./lib/ballerina-parser-2201.7.0.jar"
version = "2201.8.4"
path="./lib/ballerina-parser-2201.8.4.jar"
12 changes: 6 additions & 6 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.7.0"
distribution-version = "2201.8.4"

[[package]]
org = "ballerina"
name = "file"
version = "1.8.1"
version = "1.9.0"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -24,7 +24,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.5.0"
version = "1.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand Down Expand Up @@ -52,7 +52,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "os"
version = "1.7.0"
version = "1.8.0"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -61,7 +61,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "time"
version = "2.3.0"
version = "2.4.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -78,4 +78,4 @@ dependencies = [
modules = [
{org = "xlibb", packageName = "graphql_federation_gateway", moduleName = "graphql_federation_gateway"}
]

4 changes: 2 additions & 2 deletions build-config/checkstyle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ apply plugin: 'java'

task downloadCheckstyleRuleFiles(type: Download) {
src([
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.3/checkstyle/checkstyle.xml',
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.3/checkstyle/suppressions.xml'
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.4/checkstyle/jdk-17/checkstyle.xml',
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.4/checkstyle/jdk-17/suppressions.xml'
])
overwrite false
onlyIfNewer true
Expand Down
12 changes: 6 additions & 6 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ repository = "https://github.com/xlibb/graphql-federation-gateway"
license = ["Apache-2.0"]
distribution = "@ballerina.lang.version@"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.xlibb.gateway"
artifactId = "gateway-native"
version = "@toml.version@"
path = "../native/build/libs/[email protected]@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.graphql-java"
artifactId = "graphql-java"
version = "@graphql.java.version@"
path="./lib/[email protected]@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.graphql-java"
artifactId = "graphql-java-extended-scalars"
version = "@graphql.java.extended.scalars.version@"
path="./lib/graphql-java-extended-scalars-@[email protected]"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "commons-io"
artifactId = "commons-io"
version = "@commons.io.version@"
path="./lib/[email protected]@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "org.ballerinalang"
artifactId = "formatter-core"
version = "@ballerina.lang.version@"
path="./lib/[email protected]@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "org.ballerinalang"
artifactId = "ballerina-parser"
version = "@ballerina.lang.version@"
Expand Down
23 changes: 11 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
org.gradle.caching=true
group=io.xlibb
version=0.1.0-SNAPSHOT

#dependency
ballerinaLangVersion=2201.7.0
ballerinaLangVersion=2201.8.4
githubJohnrengelmanShadowVersion=5.2.0
underCouchDownloadVersion=4.0.4
researchgateReleaseVersion=2.8.0
slf4jVersion=1.7.30
commonsLang3Version=3.9
commonsLoggingVersion=1.2
commonsIoVersion=2.11.0
commonsIoVersion=2.12.0
commonsCompressVersion=1.21
graphqlJavaVersion=20.0
graphqlJavaVersion=20.6
graphqlJavaExtendedScalarVersion=20.0
org.gradle.jvmargs=-Xmx4096M
checkstylePluginVersion=8.18
spotbugsPluginVersion=4.5.1
shadowJarPluginVersion=5.2.0
downloadPluginVersion=4.0.4
releasePluginVersion=2.6.0
testngVersion=7.4.0
checkstylePluginVersion=10.12.0
spotbugsPluginVersion=5.0.14
shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0
testngVersion=7.6.1
eclipseLsp4jVersion=0.12.0
ballerinaGradlePluginVersion=1.0.3
jacocoVersion=0.8.8
ballerinaGradlePluginVersion=2.0.1
jacocoVersion=0.8.10
okhttpVersion=3.14.0
okioVersion=2.2.2
kotlinVersion=1.2.60
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Jan 17 14:13:37 IST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading