console: Pass hasura project name as args for neon create DB mutation

[GT-381]: https://hasurahq.atlassian.net/browse/GT-381?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7409
Co-authored-by: Mohd Bilal <24944223+m-Bilal@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
Co-authored-by: Nicolas Inchauspe <710410+nicoinch@users.noreply.github.com>
Co-authored-by: Stefano Magni <173663+NoriSte@users.noreply.github.com>
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: ananya-2410 <107847554+ananya-2410@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: f900d38a71a4306b208bc0cf406c109c3b7c028d
This commit is contained in:
Varun Dey 2023-02-01 01:59:59 +05:30 committed by hasura-bot
parent a7af427d38
commit 2508b35c90
2 changed files with 6 additions and 2 deletions

View File

@ -80,6 +80,7 @@ type CloudServerEnv = {
isAdminSecretSet: boolean; isAdminSecretSet: boolean;
luxDataHost: string; // e.g. "data.pro.hasura.io" luxDataHost: string; // e.g. "data.pro.hasura.io"
projectID: UUID; projectID: UUID;
projectName: string;
serverVersion: string; serverVersion: string;
tenantID: UUID; tenantID: UUID;
urlPrefix: string; urlPrefix: string;
@ -145,6 +146,7 @@ export type EnvVars = {
cliUUID?: string; cliUUID?: string;
tenantID?: UUID; tenantID?: UUID;
projectID?: UUID; projectID?: UUID;
projectName?: string;
cloudRootDomain?: string; cloudRootDomain?: string;
herokuOAuthClientId?: string; herokuOAuthClientId?: string;
luxDataHost?: string; luxDataHost?: string;
@ -209,6 +211,7 @@ const globals = {
herokuOAuthClientId: window.__env?.herokuOAuthClientId, herokuOAuthClientId: window.__env?.herokuOAuthClientId,
hasuraCloudTenantId: window.__env?.tenantID, hasuraCloudTenantId: window.__env?.tenantID,
hasuraCloudProjectId: window.__env?.projectID, hasuraCloudProjectId: window.__env?.projectID,
hasuraCloudProjectName: window.__env?.projectName,
neonOAuthClientId: window.__env?.neonOAuthClientId, neonOAuthClientId: window.__env?.neonOAuthClientId,
neonRootDomain: window.__env?.neonRootDomain, neonRootDomain: window.__env?.neonRootDomain,
allowedLuxFeatures: window.__env?.allowedLuxFeatures || [], allowedLuxFeatures: window.__env?.allowedLuxFeatures || [],

View File

@ -13,8 +13,8 @@ type CreateDatabaseResponse = {
}; };
const NEON_CREATE_DATABASE_QUERY = ` const NEON_CREATE_DATABASE_QUERY = `
mutation neonCreateDatabase ($projectId:uuid!) { mutation neonCreateDatabase ($projectId:uuid!, $projectName:String) {
neonCreateDatabase (projectId: $projectId) { neonCreateDatabase (projectId: $projectId, projectName: $projectName) {
databaseUrl databaseUrl
email email
envVar envVar
@ -56,6 +56,7 @@ export function useNeonDatabase() {
query: NEON_CREATE_DATABASE_QUERY, query: NEON_CREATE_DATABASE_QUERY,
variables: { variables: {
projectId: globals.hasuraCloudProjectId || '', projectId: globals.hasuraCloudProjectId || '',
projectName: globals.hasuraCloudProjectName || '',
}, },
}); });
}, []); }, []);