-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
212 additions
and
1,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
#!/bin/bash | ||
|
||
subgraphs=("inventory" "products" "users" "pandas" "reviews") | ||
subgraphs=("inventory" "products" "users" "reviews") | ||
|
||
url_inventory="http://inventory:4000/graphql" | ||
url_products="http://products:4000/graphql" | ||
url_users="http://users:4000/graphql" | ||
url_pandas="http://pandas:4000/graphql" | ||
url_reviews="http://reviews:4000/graphql" | ||
|
||
schema_inventory="subgraphs/inventory/app/src/main/resources/graphql/inventory.graphqls" | ||
schema_products="subgraphs/products/products.graphql" | ||
schema_users="subgraphs/users/users.graphql" | ||
schema_pandas="subgraphs/pandas/pandas.graphql" | ||
schema_reviews="subgraphs/reviews/reviews.graphql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
#!/bin/bash | ||
|
||
subgraphs=("products" "inventory" "users" "pandas" "reviews") | ||
subgraphs=("products" "inventory" "users" "reviews") | ||
|
||
url_products="http://localhost:4001/graphql" | ||
url_inventory="http://localhost:4002/graphql" | ||
url_users="http://localhost:4003/graphql" | ||
url_pandas="http://localhost:4004/graphql" | ||
url_reviews="http://localhost:4005/graphql" | ||
url_reviews="http://localhost:4004/graphql" | ||
|
||
schema_products="subgraphs/products/products.graphql" | ||
schema_inventory="subgraphs/inventory/app/src/main/resources/graphql/inventory.graphqls" | ||
schema_users="subgraphs/users/users.graphql" | ||
schema_pandas="subgraphs/pandas/pandas.graphql" | ||
schema_reviews="subgraphs/reviews/reviews.graphql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
fn supergraph_service(service) { | ||
let add_headers_to_response = |response| { | ||
if response.context["set_response_headers"]?.len > 0 { | ||
response.headers["Cache-Control"] = response.context["set_response_headers"]; | ||
} | ||
}; | ||
|
||
service.map_response(add_headers_to_response); | ||
} | ||
|
||
fn subgraph_service(service, subgraph) { | ||
let store_headers_from_subgraphs = |response| { | ||
if "Cache-Control" in response.headers { | ||
if response.context["set_response_headers"] == () { | ||
response.context.set_response_headers = [] | ||
} | ||
|
||
response.context.set_response_headers += response.headers.values("Cache-Control"); | ||
} | ||
}; | ||
|
||
service.map_response(store_headers_from_subgraphs); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
FROM python:3.11 | ||
FROM node:18-bookworm-slim | ||
|
||
# install PDM | ||
RUN pip install -U pip setuptools wheel | ||
RUN pip install pdm | ||
WORKDIR /usr/src/app | ||
|
||
# copy files | ||
COPY pyproject.toml pdm.lock /project/ | ||
COPY . /project | ||
COPY package.json . | ||
|
||
WORKDIR /project | ||
RUN pdm install --prod --no-lock --no-editable | ||
RUN npm install | ||
|
||
STOPSIGNAL SIGINT | ||
COPY reviews.js . | ||
COPY reviews.graphql . | ||
|
||
CMD ["pdm", "run", "server"] | ||
CMD [ "node", "reviews.js" ] |
This file was deleted.
Oops, something went wrong.
9 changes: 6 additions & 3 deletions
9
subgraphs/pandas/package.json → subgraphs/reviews/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.