@@ -46,84 +46,3 @@ query ExampleQuery {
46
46
}
47
47
}
48
48
` ` `
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
- is two Spring applications ` base-app` and ` extend-app` that use ` graphql-kotlin-federation` to generate the schema.
58
- These apps run on different ports (` 8080` , ` 8081` ) so they can run simultaneously.
59
-
60
- The ` gateway` is a Node.js app running Apollo Gateway on port ` 4000` and connects to the two Spring apps.
61
- You can make queries against the Spring apps directly or run combined queries from the gateway.
62
-
63
- # # Running Locally
64
-
65
-
66
- # ## Spring Apps
67
- Build the Spring applications by running the following commands in the ` /federation` directory
68
-
69
- ` ` ` shell script
70
- ./gradlew clean build
71
- ` ` `
72
-
73
- > NOTE: in order to ensure you use the right version of Gradle we highly recommend to use the provided wrapper scripts
74
-
75
- Start the servers:
76
-
77
- * Run each ` Application.kt` directly from your IDE
78
- * Alternatively you can also use the spring boot plugin from the command line.
79
-
80
- ` ` ` shell script
81
- ./gradlew bootRun
82
- ` ` `
83
-
84
-
85
- Once the app has started you can explore the example schema by opening the Playground endpoint
86
- * ` base-app` http://localhost:8080/playground
87
- * ` extend-app` http://localhost:8081/playground
88
-
89
- # ## Gateway
90
-
91
- See the instructions in the gateway [README](./gateway/README.md)
92
-
93
-
94
-
95
- 1. Start ` products-subgraph` by running the Spring Boot app from the IDE or by running ` ./gradlew bootRun` from ` products-subgraph` project
96
- 2. Start ` reviews-subgraph` by running the Spring Boot app from the IDE or ` ./gradlew bootRun` from ` reviews-subgraph` project
97
- 3. Start Federated Router
98
- 1. Install [rover CLI](https://www.apollographql.com/docs/rover/getting-started)
99
- 2. Start router and compose products schema using [rover dev command](https://www.apollographql.com/docs/rover/commands/dev)
100
-
101
- ` ` ` shell
102
- # start up router and compose products schema
103
- rover dev --name products --schema ./products-subgraph/src/main/resources/graphql/schema.graphqls --url http://localhost:8080/graphql
104
- ` ` `
105
-
106
- 3. In ** another** shell run ` rover dev` to compose reviews schema
107
-
108
- ` ` ` shell
109
- rover dev --name reviews --schema ./reviews-subgraph/src/main/resources/graphql/schema.graphqls --url http://localhost:8080/graphql
110
- ` ` `
111
-
112
- 4. Open http://localhost:3000 for the query editor
113
-
114
- Example federated query
115
-
116
- ` ` ` graphql
117
- query ExampleQuery {
118
- products {
119
- id
120
- name
121
- description
122
- reviews {
123
- id
124
- text
125
- starRating
126
- }
127
- }
128
- }
129
- ` ` `
0 commit comments