Commit 562f7c58 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'vs/rename-env-to-local-env-gql' into 'master'

Rename duplicate GQL type name Environment to LocalEnvironment

See merge request gitlab-org/gitlab!74174
parents bc1b5bf0 dd954cdc
mutation cancelAutoStop($environment: Environment) { mutation cancelAutoStop($environment: LocalEnvironment) {
cancelAutoStop(environment: $environment) @client { cancelAutoStop(environment: $environment) @client {
errors errors
} }
......
mutation deleteEnvironment($environment: Environment) { mutation deleteEnvironment($environment: LocalEnvironment) {
deleteEnvironment(environment: $environment) @client { deleteEnvironment(environment: $environment) @client {
errors errors
} }
......
mutation rollbackEnvironment($environment: Environment) { mutation rollbackEnvironment($environment: LocalEnvironment) {
rollbackEnvironment(environment: $environment) @client { rollbackEnvironment(environment: $environment) @client {
errors errors
} }
......
mutation stopEnvironment($environment: Environment) { mutation stopEnvironment($environment: LocalEnvironment) {
stopEnvironment(environment: $environment) @client { stopEnvironment(environment: $environment) @client {
errors errors
} }
......
query getEnvironmentFolder($environment: NestedEnvironment) { query getEnvironmentFolder($environment: NestedLocalEnvironment) {
folder(environment: $environment) @client { folder(environment: $environment) @client {
availableCount availableCount
environments environments
......
...@@ -3,12 +3,11 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; ...@@ -3,12 +3,11 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
const mapNestedEnvironment = (env) => ({ const mapNestedEnvironment = (env) => ({
...convertObjectPropsToCamelCase(env, { deep: true }), ...convertObjectPropsToCamelCase(env, { deep: true }),
__typename: 'NestedEnvironment', __typename: 'NestedLocalEnvironment',
}); });
const mapEnvironment = (env) => ({ const mapEnvironment = (env) => ({
...convertObjectPropsToCamelCase(env), ...convertObjectPropsToCamelCase(env),
// eslint-disable-next-line @gitlab/require-i18n-strings __typename: 'LocalEnvironment',
__typename: 'Environment',
}); });
export const resolvers = (endpoint) => ({ export const resolvers = (endpoint) => ({
...@@ -22,7 +21,7 @@ export const resolvers = (endpoint) => ({ ...@@ -22,7 +21,7 @@ export const resolvers = (endpoint) => ({
__typename: 'ReviewApp', __typename: 'ReviewApp',
}, },
stoppedCount: res.data.stopped_count, stoppedCount: res.data.stopped_count,
__typename: 'EnvironmentApp', __typename: 'LocalEnvironmentApp',
})); }));
}, },
folder(_, { environment: { folderPath } }) { folder(_, { environment: { folderPath } }) {
...@@ -30,7 +29,7 @@ export const resolvers = (endpoint) => ({ ...@@ -30,7 +29,7 @@ export const resolvers = (endpoint) => ({
availableCount: res.data.available_count, availableCount: res.data.available_count,
environments: res.data.environments.map(mapEnvironment), environments: res.data.environments.map(mapEnvironment),
stoppedCount: res.data.stopped_count, stoppedCount: res.data.stopped_count,
__typename: 'EnvironmentFolder', __typename: 'LocalEnvironmentFolder',
})); }));
}, },
}, },
......
type Environment { type LocalEnvironment {
id: Int! id: Int!
globalId: ID! globalId: ID!
name: String! name: String!
...@@ -9,14 +9,14 @@ type Environment { ...@@ -9,14 +9,14 @@ type Environment {
autoStopPath: String autoStopPath: String
} }
type NestedEnvironment { type NestedLocalEnvironment {
name: String! name: String!
size: Int! size: Int!
latest: Environment! latest: LocalEnvironment!
} }
type EnvironmentFolder { type LocalEnvironmentFolder {
environments: [Environment!]! environments: [LocalEnvironment!]!
availableCount: Int! availableCount: Int!
stoppedCount: Int! stoppedCount: Int!
} }
...@@ -27,9 +27,9 @@ type ReviewApp { ...@@ -27,9 +27,9 @@ type ReviewApp {
reviewSnippet: String reviewSnippet: String
} }
type EnvironmentApp { type LocalEnvironmentApp {
stoppedCount: Int! stoppedCount: Int!
availableCount: Int! availableCount: Int!
environments: [NestedEnvironment!]! environments: [NestedLocalEnvironment!]!
reviewApp: ReviewApp! reviewApp: ReviewApp!
} }
...@@ -234,7 +234,7 @@ export const resolvedEnvironmentsApp = { ...@@ -234,7 +234,7 @@ export const resolvedEnvironmentsApp = {
canDelete: false, canDelete: false,
hasOpenedAlert: false, hasOpenedAlert: false,
}, },
__typename: 'NestedEnvironment', __typename: 'NestedLocalEnvironment',
}, },
{ {
name: 'production', name: 'production',
...@@ -368,7 +368,7 @@ export const resolvedEnvironmentsApp = { ...@@ -368,7 +368,7 @@ export const resolvedEnvironmentsApp = {
canDelete: false, canDelete: false,
hasOpenedAlert: false, hasOpenedAlert: false,
}, },
__typename: 'NestedEnvironment', __typename: 'NestedLocalEnvironment',
}, },
{ {
name: 'staging', name: 'staging',
...@@ -398,7 +398,7 @@ export const resolvedEnvironmentsApp = { ...@@ -398,7 +398,7 @@ export const resolvedEnvironmentsApp = {
canDelete: false, canDelete: false,
hasOpenedAlert: false, hasOpenedAlert: false,
}, },
__typename: 'NestedEnvironment', __typename: 'NestedLocalEnvironment',
}, },
], ],
reviewApp: { reviewApp: {
...@@ -409,7 +409,7 @@ export const resolvedEnvironmentsApp = { ...@@ -409,7 +409,7 @@ export const resolvedEnvironmentsApp = {
__typename: 'ReviewApp', __typename: 'ReviewApp',
}, },
stoppedCount: 0, stoppedCount: 0,
__typename: 'EnvironmentApp', __typename: 'LocalEnvironmentApp',
}; };
export const folder = { export const folder = {
...@@ -496,7 +496,7 @@ export const resolvedFolder = { ...@@ -496,7 +496,7 @@ export const resolvedFolder = {
enableAdvancedLogsQuerying: false, enableAdvancedLogsQuerying: false,
canDelete: false, canDelete: false,
hasOpenedAlert: false, hasOpenedAlert: false,
__typename: 'Environment', __typename: 'LocalEnvironment',
}, },
{ {
id: 41, id: 41,
...@@ -522,9 +522,9 @@ export const resolvedFolder = { ...@@ -522,9 +522,9 @@ export const resolvedFolder = {
enableAdvancedLogsQuerying: false, enableAdvancedLogsQuerying: false,
canDelete: false, canDelete: false,
hasOpenedAlert: false, hasOpenedAlert: false,
__typename: 'Environment', __typename: 'LocalEnvironment',
}, },
], ],
stoppedCount: 0, stoppedCount: 0,
__typename: 'EnvironmentFolder', __typename: 'LocalEnvironmentFolder',
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment