Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency & Tooling Updates #26

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- development
- staging
- "release/*"
- 'release/*'
- main

jobs:
Expand All @@ -14,9 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 14
- 16
node: 16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd that it had two versions? Is this a try 14 and then fall back to 16 or vice versa?

steps:
- uses: actions/checkout@v2
with:
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm i
- run: npm run test
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm i
- run: npm run test
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
16
20 changes: 10 additions & 10 deletions lib/useRestQuery/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as apolloClientLib from '@apollo/client';
import { ApolloClient, DocumentNode, gql, useMutation, useQuery } from '@apollo/client';
import { print, SelectionNode } from 'graphql';
import { Kind, OperationTypeNode, print, SelectionNode } from 'graphql';
import { first } from 'lodash';

import { IRestEndpoint } from '../types';
Expand Down Expand Up @@ -550,7 +550,7 @@ describe('validateQueryAgainstEndpoint', () => {
it('should throw an error for a query with a non-operation definitions', () => {
const query = {
definitions: [{ kind: 'ScalarTypeDefinition', name: { kind: 'Name', value: 'NULL' } }],
kind: 'Document',
kind: Kind.DOCUMENT,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

} as DocumentNode;

expect(() => validateQueryAgainstEndpoint(query, dummyEndpoint)).toThrowError(
Expand All @@ -562,12 +562,12 @@ describe('validateQueryAgainstEndpoint', () => {
const query: DocumentNode = {
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
selectionSet: { kind: 'SelectionSet', selections: [] as readonly SelectionNode[] },
kind: Kind.OPERATION_DEFINITION,
operation: OperationTypeNode.QUERY,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

selectionSet: { kind: Kind.SELECTION_SET, selections: [] as readonly SelectionNode[] },
},
],
kind: 'Document',
kind: Kind.DOCUMENT,
};

expect(() => validateQueryAgainstEndpoint(query, dummyEndpoint)).toThrowError(
Expand All @@ -579,15 +579,15 @@ describe('validateQueryAgainstEndpoint', () => {
const query: DocumentNode = {
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
kind: Kind.OPERATION_DEFINITION,
operation: OperationTypeNode.QUERY,
selectionSet: {
kind: 'SelectionSet',
kind: Kind.SELECTION_SET,
selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'NULL' } }] as readonly SelectionNode[],
},
},
],
kind: 'Document',
kind: Kind.DOCUMENT,
};

expect(() => validateQueryAgainstEndpoint(query, dummyEndpoint)).toThrowError('Query selection must be a field');
Expand Down
Loading
Loading