Skip to content

Commit 2687c2b

Browse files
authored
feat(deployment): add public graphql api route (#6634)
1 parent f796f7e commit 2687c2b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

deployment/services/environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function prepareEnvironment(input: {
2222
: input.environment;
2323

2424
const appDns = `app.${input.rootDns}`;
25+
const apiDns = `api.${input.rootDns}`;
2526

2627
return {
2728
envVars: {
@@ -38,6 +39,7 @@ export function prepareEnvironment(input: {
3839
encryptionSecret,
3940
release: input.release,
4041
appDns,
42+
apiDns,
4143
rootDns: input.rootDns,
4244
};
4345
}

deployment/services/proxy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,15 @@ export function deployProxy({
100100
service: usage.service,
101101
retriable: true,
102102
},
103+
])
104+
.registerService({ record: environment.apiDns }, [
105+
{
106+
name: 'graphql-api',
107+
path: '/graphql',
108+
customRewrite: '/graphql-public',
109+
service: graphql.service,
110+
requestTimeout: '60s',
111+
retriable: true,
112+
},
103113
]);
104114
}

0 commit comments

Comments
 (0)