diff --git a/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js b/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js index c50bc2c958..6d5877d90c 100644 --- a/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js +++ b/cypress/e2e/paths/search/granules/granule_details/granule_details.cy.js @@ -68,7 +68,7 @@ describe('Path /search/granules/granule-details', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $id: String!\\n ) {\\n granule(\\n conceptId: $id\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G1287941210-ASF"}}') { + if (JSON.stringify(req.body) === `{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"params":{"conceptId":"${granuleId}"}}}`) { req.alias = 'graphQlGranuleQuery' req.reply({ body: getGranuleGraphQlBody, diff --git a/cypress/e2e/paths/search/granules/granules.cy.js b/cypress/e2e/paths/search/granules/granules.cy.js index 92999d7d66..48d53f507d 100644 --- a/cypress/e2e/paths/search/granules/granules.cy.js +++ b/cypress/e2e/paths/search/granules/granules.cy.js @@ -1132,7 +1132,7 @@ describe('Path /search/granules', () => { }) } - if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $id: String!\\n ) {\\n granule(\\n conceptId: $id\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2058417402-LPDAAC_ECS"}}') { + if (JSON.stringify(req.body) === '{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"params":{"conceptId":"G2058417402-LPDAAC_ECS"}}}') { req.alias = 'graphQlGranuleQuery' req.reply({ body: focusedGranuleGranuleGraphQlBody, diff --git a/cypress/support/graphQlGetCollection.js b/cypress/support/graphQlGetCollection.js index 4dd2d7d26f..fd085d07df 100644 --- a/cypress/support/graphQlGetCollection.js +++ b/cypress/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $id: String!\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $subscriberId: String\\n ) {\\n collection (\\n conceptId: $id\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n ) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` diff --git a/cypress/support/graphQlGetCollections.js b/cypress/support/graphQlGetCollections.js index 86e5cdb186..c49aff0a0a 100644 --- a/cypress/support/graphQlGetCollections.js +++ b/cypress/support/graphQlGetCollections.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"ids":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeGranuleCounts":true,"includeHasGranules":true,"pageSize":1}}` +export const graphQlGetCollections = (conceptId) => `{"query":"\\n query GetProjectCollections ($params: CollectionsInput, $subcriptionParams: SubscriptionsInput) {\\n collections (\\n params: $params\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeHasGranules":true,"pageSize":1},"subcriptionParams":{}}}` diff --git a/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js b/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js index f8a00a6132..a55bcebabf 100644 --- a/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js +++ b/serverless/src/retrieveGranuleLinks/fetchCmrLinks.js @@ -1,65 +1,13 @@ import axios from 'axios' -import camelcaseKeys from 'camelcase-keys' -import { prepareGranuleAccessParams } from '../../../sharedUtils/prepareGranuleAccessParams' import { getApplicationConfig, getEarthdataConfig } from '../../../sharedUtils/config' import { getDownloadUrls } from '../../../sharedUtils/getDownloadUrls' import { getS3Urls } from '../../../sharedUtils/getS3Urls' import { getBrowseUrls } from '../../../sharedUtils/getBrowseUrls' const granulesGraphQlQuery = ` - query GetGranuleLinks( - $boundingBox: [String] - $browseOnly: Boolean - $circle: [String] - $cloudCover: JSON - $collectionConceptId: String - $conceptId: [String] - $cursor: String - $dayNightFlag: String - $equatorCrossingDate: JSON - $equatorCrossingLongitude: JSON - $exclude: JSON - $limit: Int - $line: [String] - $linkTypes: [String] - $offset: Int - $onlineOnly: Boolean - $options: JSON - $orbitNumber: JSON - $point: [String] - $polygon: [String] - $readableGranuleName: [String] - $sortKey: [String] - $temporal: String - $twoDCoordinateSystem: JSON - ) { - granules( - boundingBox: $boundingBox - browseOnly: $browseOnly - circle: $circle - cloudCover: $cloudCover - collectionConceptId: $collectionConceptId - conceptId: $conceptId - cursor: $cursor - dayNightFlag: $dayNightFlag - equatorCrossingDate: $equatorCrossingDate - equatorCrossingLongitude: $equatorCrossingLongitude - exclude: $exclude - limit: $limit - line: $line - linkTypes: $linkTypes - offset: $offset - onlineOnly: $onlineOnly - options: $options - orbitNumber: $orbitNumber - point: $point - polygon: $polygon - readableGranuleName: $readableGranuleName - sortKey: $sortKey - temporal: $temporal - twoDCoordinateSystem: $twoDCoordinateSystem - ) { + query GetGranuleLinks( $params: GranulesInput ) { + granules( params: $params) { cursor items { links @@ -81,14 +29,16 @@ export const fetchCmrLinks = async ({ const graphQlUrl = `${graphQlHost}/api` - const preparedGranuleParams = camelcaseKeys(prepareGranuleAccessParams(granuleParams)) + const { concept_id: conceptIdsFromParams = [] } = granuleParams const variables = { - ...preparedGranuleParams, - limit: parseInt(granuleLinksPageSize, 10), - linkTypes: linkTypes.split(','), - collectionConceptId: collectionId, - cursor + params: { + limit: parseInt(granuleLinksPageSize, 10), + linkTypes: linkTypes.split(','), + collectionConceptId: collectionId, + conceptId: conceptIdsFromParams, + cursor + } } const response = await axios({ diff --git a/static/src/js/actions/exportSearch.js b/static/src/js/actions/exportSearch.js index 856f93905a..d47d5469c6 100644 --- a/static/src/js/actions/exportSearch.js +++ b/static/src/js/actions/exportSearch.js @@ -132,78 +132,8 @@ export const exportSearchAsStac = (format) => (dispatch, getState) => { const graphQlRequestObject = new ExportSearchRequest(authToken, earthdataEnvironment) const graphQuery = ` - query SearchCollections( - $boundingBox: [String] - $circle: [String] - $cloudHosted: Boolean - $collectionDataType: [String] - $dataCenter: String - $dataCenterH: [String] - $facetsSize: Int - $granuleDataFormat: String - $granuleDataFormatH: [String] - $hasGranulesOrCwic: Boolean - $horizontalDataResolutionRange: [String] - $instrument: String - $instrumentH: [String] - $keyword: String - $line: [String] - $offset: Int - $options: JSON - $platform: String - $platformH: [String] - $point: [String] - $polygon: [String] - $processingLevelIdH: [String] - $project: String - $projectH: [String] - $provider: String - $scienceKeywordsH: JSON - $serviceType: [String] - $sortKey: [String] - $spatialKeyword: String - $tagKey: [String] - $temporal: String - $twoDCoordinateSystemName: [String] - $limit: Int - $cursor: String - ) { - collections ( - boundingBox: $boundingBox - circle: $circle - cloudHosted: $cloudHosted - collectionDataType: $collectionDataType - dataCenter: $dataCenter - dataCenterH: $dataCenterH - facetsSize: $facetsSize - granuleDataFormat: $granuleDataFormat - granuleDataFormatH: $granuleDataFormatH - hasGranulesOrCwic: $hasGranulesOrCwic - horizontalDataResolutionRange: $horizontalDataResolutionRange - instrument: $instrument - instrumentH: $instrumentH - keyword: $keyword - line: $line - offset: $offset - options: $options - platform: $platform - platformH: $platformH - point: $point - polygon: $polygon - processingLevelIdH: $processingLevelIdH - project: $project - projectH: $projectH - provider: $provider - scienceKeywordsH: $scienceKeywordsH - serviceType: $serviceType - sortKey: $sortKey - spatialKeyword: $spatialKeyword - tagKey: $tagKey - temporal: $temporal - twoDCoordinateSystemName: $twoDCoordinateSystemName - limit: $limit, - cursor: $cursor - ) { + query SearchCollections($params: CollectionsInput) { + collections (params: $params) { cursor items { provider diff --git a/static/src/js/actions/focusedCollection.js b/static/src/js/actions/focusedCollection.js index 8181732ea9..006becf16d 100644 --- a/static/src/js/actions/focusedCollection.js +++ b/static/src/js/actions/focusedCollection.js @@ -82,16 +82,9 @@ export const getFocusedCollection = () => async (dispatch, getState) => { const graphQuery = ` query GetCollection( - $id: String! - $includeHasGranules: Boolean - $includeTags: String - $subscriberId: String + $params: CollectionInput, $subcriptionParams: SubscriptionsInput ) { - collection ( - conceptId: $id - includeHasGranules: $includeHasGranules - includeTags: $includeTags - ) { + collection (params: $params) { abstract archiveAndDistributionInformation associatedDois @@ -153,7 +146,7 @@ export const getFocusedCollection = () => async (dispatch, getState) => { } } subscriptions ( - subscriberId: $subscriberId + params: $subcriptionParams ) { count items { @@ -189,10 +182,14 @@ export const getFocusedCollection = () => async (dispatch, getState) => { }` const response = graphQlRequestObject.search(graphQuery, { - id: focusedCollectionId, - includeHasGranules: true, - includeTags: defaultCmrSearchTags.join(','), - subscriberId: username + params: { + conceptId: focusedCollectionId, + includeHasGranules: true, + includeTags: defaultCmrSearchTags.join(',') + }, + subcriptionParams: { + subscriberId: username + } }) .then((responseObject) => { const payload = [] diff --git a/static/src/js/actions/focusedGranule.js b/static/src/js/actions/focusedGranule.js index 0521d87bd3..c692bb3940 100644 --- a/static/src/js/actions/focusedGranule.js +++ b/static/src/js/actions/focusedGranule.js @@ -51,10 +51,10 @@ export const getFocusedGranule = () => (dispatch, getState) => { const graphQuery = ` query GetGranule( - $id: String! + $params: GranuleInput ) { granule( - conceptId: $id + params: $params ) { granuleUr granuleSize @@ -77,7 +77,9 @@ export const getFocusedGranule = () => (dispatch, getState) => { }` const response = graphQlRequestObject.search(graphQuery, { - id: focusedGranuleId + params: { + conceptId: focusedGranuleId + } }) .then((responseObject) => { const payload = [] diff --git a/static/src/js/actions/project.js b/static/src/js/actions/project.js index f92a4538bd..b27a87d49c 100644 --- a/static/src/js/actions/project.js +++ b/static/src/js/actions/project.js @@ -205,25 +205,15 @@ export const getProjectCollections = () => async (dispatch, getState) => { const searchParams = buildCollectionSearchParams(collectionParams) const { - includeGranuleCounts, includeHasGranules } = searchParams const graphQlRequestObject = new GraphQlRequest(authToken, earthdataEnvironment) const graphQuery = ` - query GetProjectCollections ( - $ids: [String] - $includeHasGranules: Boolean - $includeTags: String - $pageSize: Int - $subscriberId: String - ) { + query GetProjectCollections ($params: CollectionsInput, $subcriptionParams: SubscriptionsInput) { collections ( - conceptId: $ids - includeHasGranules: $includeHasGranules - includeTags: $includeTags - limit: $pageSize + params: $params ) { items { abstract @@ -315,7 +305,7 @@ export const getProjectCollections = () => async (dispatch, getState) => { } } subscriptions ( - subscriberId: $subscriberId + params: $subcriptionParams ) { count items { @@ -350,12 +340,15 @@ export const getProjectCollections = () => async (dispatch, getState) => { }` const response = graphQlRequestObject.search(graphQuery, { - ids: filteredIds, - includeTags: defaultCmrSearchTags.join(','), - includeGranuleCounts, - includeHasGranules, - pageSize: filteredIds.length, - subscriberId: username + params: { + conceptId: filteredIds, + includeTags: defaultCmrSearchTags.join(','), + includeHasGranules, + pageSize: filteredIds.length + }, + subcriptionParams: { + subscriberId: username + } }) .then((responseObject) => { const payload = [] diff --git a/tests/e2e/map/map.spec.js b/tests/e2e/map/map.spec.js index d3cb1b60ac..4475e158be 100644 --- a/tests/e2e/map/map.spec.js +++ b/tests/e2e/map/map.spec.js @@ -1443,7 +1443,7 @@ test.describe('Map interactions', () => { await page.route(/api$/, async (route) => { const query = route.request().postData() - expect(query).toEqual('{"query":"\\n query GetGranule(\\n $id: String!\\n ) {\\n granule(\\n conceptId: $id\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"id":"G2061166811-ASF"}}') + expect(query).toEqual('{"query":"\\n query GetGranule(\\n $params: GranuleInput\\n ) {\\n granule(\\n params: $params\\n ) {\\n granuleUr\\n granuleSize\\n title\\n onlineAccessFlag\\n dayNightFlag\\n timeStart\\n timeEnd\\n dataCenter\\n originalFormat\\n conceptId\\n collectionConceptId\\n spatialExtent\\n temporalExtent\\n relatedUrls\\n dataGranule\\n measuredParameters\\n providerDates\\n }\\n }","variables":{"params":{"conceptId":"G2061166811-ASF"}}}') await route.fulfill({ json: granuleGraphQlBody, diff --git a/tests/support/graphQlGetCollection.js b/tests/support/graphQlGetCollection.js index 4dd2d7d26f..fd085d07df 100644 --- a/tests/support/graphQlGetCollection.js +++ b/tests/support/graphQlGetCollection.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $id: String!\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $subscriberId: String\\n ) {\\n collection (\\n conceptId: $id\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n ) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"id":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"}}` +export const graphQlGetCollection = (conceptId) => `{"query":"\\n query GetCollection(\\n $params: CollectionInput, $subcriptionParams: SubscriptionsInput\\n ) {\\n collection (params: $params) {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n nativeDataFormats\\n points\\n polygons\\n relatedUrls\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n }\\n }\\n granules {\\n count\\n items {\\n conceptId\\n onlineAccessFlag\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n nativeId\\n query\\n type\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":"${conceptId}","includeHasGranules":true,"includeTags":"edsc.*,opensearch.granule.osdd"},"subcriptionParams":{}}}` diff --git a/tests/support/graphQlProjectGetCollections.js b/tests/support/graphQlProjectGetCollections.js index 293f6f2c47..2e12576122 100644 --- a/tests/support/graphQlProjectGetCollections.js +++ b/tests/support/graphQlProjectGetCollections.js @@ -2,4 +2,4 @@ * Return the GraphQl query for verifying the request is what we expect inside of cy.intercept * @param {String} conceptId conceptId to retrieve */ -export const graphQlGetProjectCollections = (conceptId) => `{"query":"\\n query GetProjectCollections (\\n $ids: [String]\\n $includeHasGranules: Boolean\\n $includeTags: String\\n $pageSize: Int\\n $subscriberId: String\\n ) {\\n collections (\\n conceptId: $ids\\n includeHasGranules: $includeHasGranules\\n includeTags: $includeTags\\n limit: $pageSize\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n subscriberId: $subscriberId\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"ids":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeGranuleCounts":true,"includeHasGranules":true,"pageSize":1}}` +export const graphQlGetProjectCollections = (conceptId) => `{"query":"\\n query GetProjectCollections ($params: CollectionsInput, $subcriptionParams: SubscriptionsInput) {\\n collections (\\n params: $params\\n ) {\\n items {\\n abstract\\n archiveAndDistributionInformation\\n associatedDois\\n boxes\\n cloudHosted\\n conceptId\\n coordinateSystem\\n dataCenter\\n dataCenters\\n dataQualitySummaries {\\n count\\n items {\\n id\\n summary\\n }\\n }\\n directDistributionInformation\\n doi\\n duplicateCollections {\\n count\\n items {\\n id\\n }\\n }\\n hasGranules\\n lines\\n points\\n polygons\\n relatedCollections (\\n limit: 3\\n ) {\\n count\\n items {\\n id\\n title\\n }\\n }\\n relatedUrls\\n scienceKeywords\\n shortName\\n spatialExtent\\n tags\\n temporalExtents\\n tilingIdentificationSystems\\n title\\n versionId\\n services {\\n count\\n items {\\n conceptId\\n longName\\n name\\n type\\n url\\n serviceOptions\\n supportedOutputProjections\\n supportedReformattings\\n maxItemsPerOrder\\n orderOptions {\\n count\\n items {\\n conceptId\\n name\\n form\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n granules {\\n count\\n items {\\n browseFlag\\n conceptId\\n onlineAccessFlag\\n links\\n }\\n }\\n subscriptions (\\n params: $subcriptionParams\\n ) {\\n count\\n items {\\n collectionConceptId\\n conceptId\\n name\\n query\\n }\\n }\\n tools {\\n count\\n items {\\n longName\\n name\\n potentialAction\\n }\\n }\\n variables {\\n count\\n items {\\n conceptId\\n definition\\n instanceInformation\\n longName\\n name\\n nativeId\\n scienceKeywords\\n }\\n }\\n }\\n }\\n }","variables":{"params":{"conceptId":["${conceptId}"],"includeTags":"edsc.*,opensearch.granule.osdd","includeHasGranules":true,"pageSize":1},"subcriptionParams":{}}}`