diff --git a/serverless.yml b/serverless.yml index 45672e61e..fa07e048f 100644 --- a/serverless.yml +++ b/serverless.yml @@ -31,7 +31,7 @@ provider: ummServiceVersion: '1.3.4' ummSubscriptionVersion: '1.1' ummToolVersion: '1.1' - ummVariableVersion: '1.8.1' + ummVariableVersion: '1.9.0' vpc: securityGroupIds: diff --git a/src/resolvers/__tests__/variable.test.js b/src/resolvers/__tests__/variable.test.js index cb1eae76c..ae544ed71 100644 --- a/src/resolvers/__tests__/variable.test.js +++ b/src/resolvers/__tests__/variable.test.js @@ -44,16 +44,25 @@ describe('Variable', () => { } }, umm: { + AdditionalIdentifiers: [], DataType: 'Dolor Nullam Venenatis', Definition: 'Cras mattis consectetur purus sit amet fermentum.', Dimensions: {}, + FillValues: [], + IndexRanges: {}, + InstanceInformation: {}, LongName: 'Vehicula Aenean Lorem', MeasurementIdentifiers: [], Name: 'Vehicula', Offset: 1.234, + RelatedURLs: [], Scale: 1.234, ScienceKeywords: [], + Sets: [], + StandardName: 'all values standard name', Units: 'K', + ValidRanges: {}, + VariableSubType: 'SCIENCE_SCALAR', VariableType: 'Malesuada' } }] @@ -65,19 +74,28 @@ describe('Variable', () => { variables { count items { + additionalIdentifiers associationDetails conceptId dataType definition dimensions + fillValues + indexRanges + instanceInformation longName measurementIdentifiers name nativeId offset + relatedUrls scale scienceKeywords + sets + standardName units + validRanges + variableSubType variableType } } @@ -92,6 +110,7 @@ describe('Variable', () => { variables: { count: 1, items: [{ + additionalIdentifiers: [], associationDetails: { collections: [ { @@ -103,14 +122,22 @@ describe('Variable', () => { dataType: 'Dolor Nullam Venenatis', definition: 'Cras mattis consectetur purus sit amet fermentum.', dimensions: {}, + fillValues: [], + indexRanges: {}, + instanceInformation: {}, longName: 'Vehicula Aenean Lorem', measurementIdentifiers: [], name: 'Vehicula', nativeId: 'test-guid', offset: 1.234, + relatedUrls: [], scale: 1.234, scienceKeywords: [], + sets: [], + standardName: 'all values standard name', units: 'K', + validRanges: {}, + variableSubType: 'SCIENCE_SCALAR', variableType: 'Malesuada' }] } diff --git a/src/resolvers/__tests__/variableDraft.test.js b/src/resolvers/__tests__/variableDraft.test.js index 6fc188243..d39d0aa66 100644 --- a/src/resolvers/__tests__/variableDraft.test.js +++ b/src/resolvers/__tests__/variableDraft.test.js @@ -23,6 +23,93 @@ describe('Variable Draft', () => { describe('Query', () => { describe('variableDraft', () => { describe('with results', () => { + test('all variable draft fields', async () => { + nock(/example/) + .defaultReplyHeaders({ + 'X-Request-Id': 'abcd-1234-efgh-5678' + }) + .get(/api\/variable_drafts/) + .reply(200, { + draft: { + AdditionalIdentifiers: [], + DataType: 'byte', + Definition: 'Mock Definition', + Dimensions: {}, + FillValues: [], + IndexRanges: {}, + InstanceInformation: {}, + LongName: 'Mock Long Name', + MeasurementIdentifiers: [], + Name: 'Mock Variable Draft Name', + Offset: 1.234, + RelatedURLs: [], + Scale: 1.234, + ScienceKeywords: [], + Sets: [], + StandardName: 'Mock Standard Name', + Units: 'K', + ValidRanges: {}, + VariableSubType: 'SCIENCE_SCALAR', + VariableType: 'Mock Variable Types' + } + }) + const response = await server.executeOperation({ + variables: {}, + query: `{ + variableDraft (params: { id: 123 }) { + additionalIdentifiers + dataType + definition + dimensions + fillValues + indexRanges + instanceInformation + longName + measurementIdentifiers + name + offset + relatedUrls + scale + scienceKeywords + sets + standardName + units + validRanges + variableSubType + variableType + } + }` + }, { + contextValue + }) + + const { data } = response.body.singleResult + + expect(data).toEqual({ + variableDraft: { + additionalIdentifiers: [], + dataType: 'byte', + definition: 'Mock Definition', + dimensions: {}, + fillValues: [], + indexRanges: {}, + instanceInformation: {}, + longName: 'Mock Long Name', + measurementIdentifiers: [], + name: 'Mock Variable Draft Name', + offset: 1.234, + relatedUrls: [], + scale: 1.234, + scienceKeywords: [], + sets: [], + standardName: 'Mock Standard Name', + units: 'K', + validRanges: {}, + variableSubType: 'SCIENCE_SCALAR', + variableType: 'Mock Variable Types' + } + }) + }) test('returns results', async () => { nock(/example/) .defaultReplyHeaders({ diff --git a/src/types/variable.graphql b/src/types/variable.graphql index d1b7f5378..bde5de029 100644 --- a/src/types/variable.graphql +++ b/src/types/variable.graphql @@ -15,6 +15,8 @@ type Variable { fillValues: JSON "This element describes the x and y dimension ranges for this variable. Typically these values are 2 latitude and longitude ranges, but they don't necessarily have to be." indexRanges: JSON + "Describes a store (zarr) where a variable has been separated from its original data files and saved as its own entity." + instanceInformation: JSON "The expanded or long name related to the variable Name." longName: String "The measurement information of a variable." diff --git a/src/types/variableDraft.graphql b/src/types/variableDraft.graphql index 4127130aa..ea1bd4f9e 100644 --- a/src/types/variableDraft.graphql +++ b/src/types/variableDraft.graphql @@ -11,6 +11,8 @@ type VariableDraft { fillValues: JSON "This element describes the x and y dimension ranges for this variable. Typically these values are 2 latitude and longitude ranges, but they don't necessarily have to be." indexRanges: JSON + "Describes a store (zarr) where a variable has been separated from its original data files and saved as its own entity." + instanceInformation: JSON "The expanded or long name related to the variable Name." longName: String "The measurement information of a variable." diff --git a/src/utils/umm/variableDraftKeyMap.json b/src/utils/umm/variableDraftKeyMap.json index 369d3f08d..83c008457 100644 --- a/src/utils/umm/variableDraftKeyMap.json +++ b/src/utils/umm/variableDraftKeyMap.json @@ -6,6 +6,7 @@ "dimensions": "Dimensions", "fillValues": "FillValues", "indexRanges": "IndexRanges", + "instanceInformation": "InstanceInformation", "longName": "LongName", "measurementIdentifiers": "MeasurementIdentifiers", "name": "Name", diff --git a/src/utils/umm/variableKeyMap.json b/src/utils/umm/variableKeyMap.json index 865767014..3653f077a 100644 --- a/src/utils/umm/variableKeyMap.json +++ b/src/utils/umm/variableKeyMap.json @@ -13,6 +13,7 @@ "dimensions": "umm.Dimensions", "fillValues": "umm.FillValues", "indexRanges": "umm.IndexRanges", + "instanceInformation": "umm.InstanceInformation", "longName": "umm.LongName", "measurementIdentifiers": "umm.MeasurementIdentifiers", "name": "umm.Name",