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",
|
||||
"scripts": {
|
||||
"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",
|
||||
"lint": "eslint .",
|
||||
"check": "tsc --noEmit -p tsconfig.app.json",
|
||||
|
||||
@@ -4,8 +4,5 @@
|
||||
"language": "typescript",
|
||||
"eagerEsModules": true,
|
||||
"noFutureProofEnums": true,
|
||||
"excludes": [
|
||||
"**/PublicTrustCenterGraph.ts",
|
||||
"**/trust/**"
|
||||
]
|
||||
"excludes": ["**/pages/iam/**/*", "**/node_modules/**"]
|
||||
}
|
||||
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({
|
||||
network: Network.create(makeFetchQuery("/api/console/v1/query")),
|
||||
network: Network.create(makeFetchQuery("/api/console/v1/graphql")),
|
||||
store,
|
||||
});
|
||||
|
||||
export const connectEnvironment = new Environment({
|
||||
network: Network.create(makeFetchQuery("/api/connect/v1/query")),
|
||||
network: Network.create(makeFetchQuery("/api/connect/v1/graphql")),
|
||||
store,
|
||||
});
|
||||
|
||||
@@ -5,7 +5,21 @@ import { fileURLToPath, URL } from "node:url";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react({ babel: { plugins: ["relay"] } }), tailwindcss()],
|
||||
plugins: [
|
||||
react({
|
||||
babel: {
|
||||
plugins: [
|
||||
[
|
||||
"relay",
|
||||
{
|
||||
eagerEsModules: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
}),
|
||||
tailwindcss(),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
"/connect": {
|
||||
@@ -24,21 +38,21 @@ export default defineConfig({
|
||||
},
|
||||
resolve: {
|
||||
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)),
|
||||
"/components": fileURLToPath(
|
||||
new URL("./src/components", import.meta.url),
|
||||
),
|
||||
"/coredata": fileURLToPath(
|
||||
new URL("./src/coredata", import.meta.url),
|
||||
new URL("./src/components", import.meta.url)
|
||||
),
|
||||
"/coredata": fileURLToPath(new URL("./src/coredata", import.meta.url)),
|
||||
"/hooks": fileURLToPath(new URL("./src/hooks", import.meta.url)),
|
||||
"/layouts": fileURLToPath(new URL("./src/layouts", import.meta.url)),
|
||||
"/pages": fileURLToPath(new URL("./src/pages", import.meta.url)),
|
||||
"/routes": fileURLToPath(new URL("./src/routes", import.meta.url)),
|
||||
"/providers": fileURLToPath(new URL("./src/providers", import.meta.url)),
|
||||
"/permissions": fileURLToPath(
|
||||
new URL("./src/permissions", import.meta.url),
|
||||
new URL("./src/permissions", import.meta.url)
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user