From 697c9adf0ee3cc0c65b809275f7bbfd5368ccfb7 Mon Sep 17 00:00:00 2001 From: Ian Sutherland Date: Thu, 15 Sep 2022 17:18:59 -0600 Subject: [PATCH] Update passed from value (#26) --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/get-arguments.ts | 4 ++-- test/get-arguments.test.ts | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4e4821..fac67509 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Apollo Schema Check Action Changelog +## 2.0.2 (September 15, 2022) + +- Update `from` parameter format. It seems Apollo no longer wants `sec` included with offsets. + ## 2.0.1 (July 6, 2022) - Pass `from` parameter to Apollo Studio API as a string instead of a number (see: [https://status.apollographql.com/incidents/c5dvk0tbg5bv](https://status.apollographql.com/incidents/c5dvk0tbg5bv)) diff --git a/package.json b/package.json index 52ca63f1..8dfe71da 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "apollo-schema-check-action", "description": "A GitHub Action to run a schema check with Apollo Studio and post the results as a comment on a Pull Request", - "version": "2.0.1", + "version": "2.0.2", "author": "Ian Sutherland ", "license": "MIT", "repository": { diff --git a/src/get-arguments.ts b/src/get-arguments.ts index 1c1a1f18..836273e8 100644 --- a/src/get-arguments.ts +++ b/src/get-arguments.ts @@ -85,9 +85,9 @@ const getApolloConfigFile = async (file: string): Promise => { const getFromValue = (validationPeriod: string): string => { if (validationPeriod.startsWith('P')) { - return `${toSeconds(parse(validationPeriod))} sec`; + return `${toSeconds(parse(validationPeriod))}`; } else if (validationPeriod.match(/^-?\d+$/)) { - return `${Math.abs(Number.parseInt(validationPeriod))} sec`; + return `${Math.abs(Number.parseInt(validationPeriod))}`; } else { return validationPeriod; } diff --git a/test/get-arguments.test.ts b/test/get-arguments.test.ts index 4acdb6a4..834d0e90 100644 --- a/test/get-arguments.test.ts +++ b/test/get-arguments.test.ts @@ -92,15 +92,15 @@ describe.skip('getQueryVariables', () => { describe('getFromValue', () => { test('negative number of seconds', () => { - expect(getFromValue('-86400')).toBe('86400 sec'); + expect(getFromValue('-86400')).toBe('86400'); }); test('positive number of seconds', () => { - expect(getFromValue('300')).toBe('300 sec'); + expect(getFromValue('300')).toBe('300'); }); test('ISO 8601 duration', () => { - expect(getFromValue('P2W')).toBe('1209600 sec'); + expect(getFromValue('P2W')).toBe('1209600'); }); test('Plain text duration', () => {