Commit 64d32586 authored by David O'Regan's avatar David O'Regan

Merge branch 'nfriend-restructure-release-graphql-queries' into 'master'

Restructure release GraphQL queries

See merge request gitlab-org/gitlab!61525
parents 529becdf ff74fe78
<script>
import createFlash from '~/flash';
import { s__ } from '~/locale';
import oneReleaseQuery from '../queries/one_release.query.graphql';
import oneReleaseQuery from '../graphql/queries/one_release.query.graphql';
import { convertGraphQLRelease } from '../util';
import ReleaseBlock from './release_block.vue';
import ReleaseSkeletonLoader from './release_skeleton_loader.vue';
......
#import "./release.fragment.graphql"
#import "../fragments/release.fragment.graphql"
query allReleases(
$fullPath: ID!
......
#import "./release.fragment.graphql"
#import "../fragments/release.fragment.graphql"
query oneRelease($fullPath: ID!, $tagName: String!) {
project(fullPath: $fullPath) {
......
#import "./release_for_editing.fragment.graphql"
#import "../fragments/release_for_editing.fragment.graphql"
query oneReleaseForEditing($fullPath: ID!, $tagName: String!) {
project(fullPath: $fullPath) {
......
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { redirectTo } from '~/lib/utils/url_utility';
import { s__ } from '~/locale';
import createReleaseMutation from '~/releases/queries/create_release.mutation.graphql';
import createReleaseAssetLinkMutation from '~/releases/queries/create_release_link.mutation.graphql';
import deleteReleaseAssetLinkMutation from '~/releases/queries/delete_release_link.mutation.graphql';
import oneReleaseForEditingQuery from '~/releases/queries/one_release_for_editing.query.graphql';
import updateReleaseMutation from '~/releases/queries/update_release.mutation.graphql';
import createReleaseMutation from '~/releases/graphql/mutations/create_release.mutation.graphql';
import createReleaseAssetLinkMutation from '~/releases/graphql/mutations/create_release_link.mutation.graphql';
import deleteReleaseAssetLinkMutation from '~/releases/graphql/mutations/delete_release_link.mutation.graphql';
import updateReleaseMutation from '~/releases/graphql/mutations/update_release.mutation.graphql';
import oneReleaseForEditingQuery from '~/releases/graphql/queries/one_release_for_editing.query.graphql';
import { gqClient, convertOneReleaseGraphQLResponse } from '~/releases/util';
import * as types from './mutation_types';
......
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '~/locale';
import { PAGE_SIZE } from '~/releases/constants';
import allReleasesQuery from '~/releases/queries/all_releases.query.graphql';
import allReleasesQuery from '~/releases/graphql/queries/all_releases.query.graphql';
import { gqClient, convertAllReleasesGraphQLResponse } from '~/releases/util';
import * as types from './mutation_types';
......
......@@ -890,8 +890,8 @@ helper method. For example:
describe GraphQL::Query, type: :request do
include GraphqlHelpers
all_releases_query_path = 'releases/queries/all_releases.query.graphql'
fragment_paths = ['releases/queries/release.fragment.graphql']
all_releases_query_path = 'releases/graphql/queries/all_releases.query.graphql'
fragment_paths = ['releases/graphql/fragments/release.fragment.graphql']
before(:all) do
clean_frontend_fixtures('graphql/releases/')
......@@ -908,7 +908,7 @@ end
```
This will create a new fixture located at
`tmp/tests/frontend/fixtures-ee/graphql/releases/queries/all_releases.query.graphql.json`.
`tmp/tests/frontend/fixtures-ee/graphql/releases/graphql/queries/all_releases.query.graphql.json`.
You will need to provide the paths to all fragments used by the query.
`get_graphql_query_as_string` reads all of the provided file paths and returns
......
......@@ -119,11 +119,11 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
describe GraphQL::Query, type: :request do
include GraphqlHelpers
all_releases_query_path = 'releases/queries/all_releases.query.graphql'
one_release_query_path = 'releases/queries/one_release.query.graphql'
one_release_for_editing_query_path = 'releases/queries/one_release_for_editing.query.graphql'
release_fragment_path = 'releases/queries/release.fragment.graphql'
release_for_editing_fragment_path = 'releases/queries/release_for_editing.fragment.graphql'
all_releases_query_path = 'releases/graphql/queries/all_releases.query.graphql'
one_release_query_path = 'releases/graphql/queries/one_release.query.graphql'
one_release_for_editing_query_path = 'releases/graphql/queries/one_release_for_editing.query.graphql'
release_fragment_path = 'releases/graphql/fragments/release.fragment.graphql'
release_for_editing_fragment_path = 'releases/graphql/fragments/release_for_editing.fragment.graphql'
before(:all) do
clean_frontend_fixtures('graphql/releases/')
......
......@@ -7,12 +7,12 @@ import createFlash from '~/flash';
import ReleaseShowApp from '~/releases/components/app_show.vue';
import ReleaseBlock from '~/releases/components/release_block.vue';
import ReleaseSkeletonLoader from '~/releases/components/release_skeleton_loader.vue';
import oneReleaseQuery from '~/releases/queries/one_release.query.graphql';
import oneReleaseQuery from '~/releases/graphql/queries/one_release.query.graphql';
jest.mock('~/flash');
const oneReleaseQueryResponse = getJSONFixture(
'graphql/releases/queries/one_release.query.graphql.json',
'graphql/releases/graphql/queries/one_release.query.graphql.json',
);
Vue.use(VueApollo);
......
......@@ -4,9 +4,9 @@ import testAction from 'helpers/vuex_action_helper';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { redirectTo } from '~/lib/utils/url_utility';
import { ASSET_LINK_TYPE } from '~/releases/constants';
import createReleaseAssetLinkMutation from '~/releases/queries/create_release_link.mutation.graphql';
import deleteReleaseAssetLinkMutation from '~/releases/queries/delete_release_link.mutation.graphql';
import updateReleaseMutation from '~/releases/queries/update_release.mutation.graphql';
import createReleaseAssetLinkMutation from '~/releases/graphql/mutations/create_release_link.mutation.graphql';
import deleteReleaseAssetLinkMutation from '~/releases/graphql/mutations/delete_release_link.mutation.graphql';
import updateReleaseMutation from '~/releases/graphql/mutations/update_release.mutation.graphql';
import * as actions from '~/releases/stores/modules/edit_new/actions';
import * as types from '~/releases/stores/modules/edit_new/mutation_types';
import createState from '~/releases/stores/modules/edit_new/state';
......@@ -28,7 +28,7 @@ jest.mock('~/releases/util', () => ({
}));
const originalOneReleaseForEditingQueryResponse = getJSONFixture(
'graphql/releases/queries/one_release_for_editing.query.graphql.json',
'graphql/releases/graphql/queries/one_release_for_editing.query.graphql.json',
);
describe('Release edit/new actions', () => {
......
......@@ -2,7 +2,7 @@ import { cloneDeep } from 'lodash';
import { getJSONFixture } from 'helpers/fixtures';
import testAction from 'helpers/vuex_action_helper';
import { PAGE_SIZE } from '~/releases/constants';
import allReleasesQuery from '~/releases/queries/all_releases.query.graphql';
import allReleasesQuery from '~/releases/graphql/queries/all_releases.query.graphql';
import {
fetchReleases,
receiveReleasesError,
......@@ -13,7 +13,7 @@ import createState from '~/releases/stores/modules/index/state';
import { gqClient, convertAllReleasesGraphQLResponse } from '~/releases/util';
const originalGraphqlReleasesResponse = getJSONFixture(
'graphql/releases/queries/all_releases.query.graphql.json',
'graphql/releases/graphql/queries/all_releases.query.graphql.json',
);
describe('Releases State actions', () => {
......
......@@ -10,7 +10,7 @@ const originalRelease = getJSONFixture('api/releases/release.json');
const originalReleases = [originalRelease];
const graphqlReleasesResponse = getJSONFixture(
'graphql/releases/queries/all_releases.query.graphql.json',
'graphql/releases/graphql/queries/all_releases.query.graphql.json',
);
describe('Releases Store Mutations', () => {
......
......@@ -7,13 +7,13 @@ import {
} from '~/releases/util';
const originalAllReleasesQueryResponse = getJSONFixture(
'graphql/releases/queries/all_releases.query.graphql.json',
'graphql/releases/graphql/queries/all_releases.query.graphql.json',
);
const originalOneReleaseQueryResponse = getJSONFixture(
'graphql/releases/queries/one_release.query.graphql.json',
'graphql/releases/graphql/queries/one_release.query.graphql.json',
);
const originalOneReleaseForEditingQueryResponse = getJSONFixture(
'graphql/releases/queries/one_release_for_editing.query.graphql.json',
'graphql/releases/graphql/queries/one_release_for_editing.query.graphql.json',
);
describe('releases/util.js', () => {
......
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