Setup 2 relay configs for 2 graphQL APIs
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"relay": "find src -type d -name \"__generated__\" -exec rm -rf {} + && npx relay-compiler ./relay.config.json",
|
"relay": "find src -type d -name \"__generated__\" -exec rm -rf {} + && npx relay-compiler ./relay.core.json && npx relay-compiler ./relay.iam.json",
|
||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"check": "tsc --noEmit -p tsconfig.app.json",
|
"check": "tsc --noEmit -p tsconfig.app.json",
|
||||||
|
|||||||
@@ -4,8 +4,5 @@
|
|||||||
"language": "typescript",
|
"language": "typescript",
|
||||||
"eagerEsModules": true,
|
"eagerEsModules": true,
|
||||||
"noFutureProofEnums": true,
|
"noFutureProofEnums": true,
|
||||||
"excludes": [
|
"excludes": ["**/pages/iam/**/*", "**/node_modules/**"]
|
||||||
"**/PublicTrustCenterGraph.ts",
|
|
||||||
"**/trust/**"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
8
apps/console/relay.iam.json
Normal file
8
apps/console/relay.iam.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"src": "./src/pages/iam",
|
||||||
|
"schema": "../../pkg/server/api/connect/v1/schema.graphql",
|
||||||
|
"language": "typescript",
|
||||||
|
"eagerEsModules": true,
|
||||||
|
"noFutureProofEnums": true,
|
||||||
|
"excludes": ["**/node_modules/**"]
|
||||||
|
}
|
||||||
@@ -8,11 +8,11 @@ const store = new Store(source, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const consoleEnvironment = new Environment({
|
export const consoleEnvironment = new Environment({
|
||||||
network: Network.create(makeFetchQuery("/api/console/v1/query")),
|
network: Network.create(makeFetchQuery("/api/console/v1/graphql")),
|
||||||
store,
|
store,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const connectEnvironment = new Environment({
|
export const connectEnvironment = new Environment({
|
||||||
network: Network.create(makeFetchQuery("/api/connect/v1/query")),
|
network: Network.create(makeFetchQuery("/api/connect/v1/graphql")),
|
||||||
store,
|
store,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,21 @@ import { fileURLToPath, URL } from "node:url";
|
|||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react({ babel: { plugins: ["relay"] } }), tailwindcss()],
|
plugins: [
|
||||||
|
react({
|
||||||
|
babel: {
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
"relay",
|
||||||
|
{
|
||||||
|
eagerEsModules: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
tailwindcss(),
|
||||||
|
],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
"/connect": {
|
"/connect": {
|
||||||
@@ -24,21 +38,21 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"/environments": fileURLToPath(new URL("./src/environments", import.meta.url)),
|
"/environments": fileURLToPath(
|
||||||
|
new URL("./src/environments", import.meta.url)
|
||||||
|
),
|
||||||
"/type": fileURLToPath(new URL("./src/type.ts", import.meta.url)),
|
"/type": fileURLToPath(new URL("./src/type.ts", import.meta.url)),
|
||||||
"/components": fileURLToPath(
|
"/components": fileURLToPath(
|
||||||
new URL("./src/components", import.meta.url),
|
new URL("./src/components", import.meta.url)
|
||||||
),
|
|
||||||
"/coredata": fileURLToPath(
|
|
||||||
new URL("./src/coredata", import.meta.url),
|
|
||||||
),
|
),
|
||||||
|
"/coredata": fileURLToPath(new URL("./src/coredata", import.meta.url)),
|
||||||
"/hooks": fileURLToPath(new URL("./src/hooks", import.meta.url)),
|
"/hooks": fileURLToPath(new URL("./src/hooks", import.meta.url)),
|
||||||
"/layouts": fileURLToPath(new URL("./src/layouts", import.meta.url)),
|
"/layouts": fileURLToPath(new URL("./src/layouts", import.meta.url)),
|
||||||
"/pages": fileURLToPath(new URL("./src/pages", import.meta.url)),
|
"/pages": fileURLToPath(new URL("./src/pages", import.meta.url)),
|
||||||
"/routes": fileURLToPath(new URL("./src/routes", import.meta.url)),
|
"/routes": fileURLToPath(new URL("./src/routes", import.meta.url)),
|
||||||
"/providers": fileURLToPath(new URL("./src/providers", import.meta.url)),
|
"/providers": fileURLToPath(new URL("./src/providers", import.meta.url)),
|
||||||
"/permissions": fileURLToPath(
|
"/permissions": fileURLToPath(
|
||||||
new URL("./src/permissions", import.meta.url),
|
new URL("./src/permissions", import.meta.url)
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user