Commit dd954cdc authored by Vitaly Slobodin's avatar Vitaly Slobodin

Rename duplicate GQL type name Environment to LocalEnvironment

See https://gitlab.com/gitlab-org/gitlab/-/issues/247052
for more information.
parent e194c893
mutation cancelAutoStop($environment: Environment) {
mutation cancelAutoStop($environment: LocalEnvironment) {
cancelAutoStop(environment: $environment) @client {
errors
}
......
mutation deleteEnvironment($environment: Environment) {
mutation deleteEnvironment($environment: LocalEnvironment) {
deleteEnvironment(environment: $environment) @client {
errors
}
......
mutation rollbackEnvironment($environment: Environment) {
mutation rollbackEnvironment($environment: LocalEnvironment) {
rollbackEnvironment(environment: $environment) @client {
errors
}
......
mutation stopEnvironment($environment: Environment) {
mutation stopEnvironment($environment: LocalEnvironment) {
stopEnvironment(environment: $environment) @client {
errors
}
......
query getEnvironmentFolder($environment: NestedEnvironment) {
query getEnvironmentFolder($environment: NestedLocalEnvironment) {
folder(environment: $environment) @client {
availableCount
environments
......
......@@ -3,12 +3,11 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
const mapNestedEnvironment = (env) => ({
...convertObjectPropsToCamelCase(env, { deep: true }),
__typename: 'NestedEnvironment',
__typename: 'NestedLocalEnvironment',
});
const mapEnvironment = (env) => ({
...convertObjectPropsToCamelCase(env),
// eslint-disable-next-line @gitlab/require-i18n-strings
__typename: 'Environment',
__typename: 'LocalEnvironment',
});
export const resolvers = (endpoint) => ({
......@@ -22,7 +21,7 @@ export const resolvers = (endpoint) => ({
__typename: 'ReviewApp',
},
stoppedCount: res.data.stopped_count,
__typename: 'EnvironmentApp',
__typename: 'LocalEnvironmentApp',
}));
},
folder(_, { environment: { folderPath } }) {
......@@ -30,7 +29,7 @@ export const resolvers = (endpoint) => ({
availableCount: res.data.available_count,
environments: res.data.environments.map(mapEnvironment),
stoppedCount: res.data.stopped_count,
__typename: 'EnvironmentFolder',
__typename: 'LocalEnvironmentFolder',
}));
},
},
......
type Environment {
type LocalEnvironment {
id: Int!
globalId: ID!
name: String!
......@@ -9,14 +9,14 @@ type Environment {
autoStopPath: String
}
type NestedEnvironment {
type NestedLocalEnvironment {
name: String!
size: Int!
latest: Environment!
latest: LocalEnvironment!
}
type EnvironmentFolder {
environments: [Environment!]!
type LocalEnvironmentFolder {
environments: [LocalEnvironment!]!
availableCount: Int!
stoppedCount: Int!
}
......@@ -27,9 +27,9 @@ type ReviewApp {
reviewSnippet: String
}
type EnvironmentApp {
type LocalEnvironmentApp {
stoppedCount: Int!
availableCount: Int!
environments: [NestedEnvironment!]!
environments: [NestedLocalEnvironment!]!
reviewApp: ReviewApp!
}
......@@ -234,7 +234,7 @@ export const resolvedEnvironmentsApp = {
canDelete: false,
hasOpenedAlert: false,
},
__typename: 'NestedEnvironment',
__typename: 'NestedLocalEnvironment',
},
{
name: 'production',
......@@ -368,7 +368,7 @@ export const resolvedEnvironmentsApp = {
canDelete: false,
hasOpenedAlert: false,
},
__typename: 'NestedEnvironment',
__typename: 'NestedLocalEnvironment',
},
{
name: 'staging',
......@@ -398,7 +398,7 @@ export const resolvedEnvironmentsApp = {
canDelete: false,
hasOpenedAlert: false,
},
__typename: 'NestedEnvironment',
__typename: 'NestedLocalEnvironment',
},
],
reviewApp: {
......@@ -409,7 +409,7 @@ export const resolvedEnvironmentsApp = {
__typename: 'ReviewApp',
},
stoppedCount: 0,
__typename: 'EnvironmentApp',
__typename: 'LocalEnvironmentApp',
};
export const folder = {
......@@ -496,7 +496,7 @@ export const resolvedFolder = {
enableAdvancedLogsQuerying: false,
canDelete: false,
hasOpenedAlert: false,
__typename: 'Environment',
__typename: 'LocalEnvironment',
},
{
id: 41,
......@@ -522,9 +522,9 @@ export const resolvedFolder = {
enableAdvancedLogsQuerying: false,
canDelete: false,
hasOpenedAlert: false,
__typename: 'Environment',
__typename: 'LocalEnvironment',
},
],
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