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

Sanitization #4

Merged
merged 8 commits into from
Feb 24, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: ["push", "pull_request"]

jobs:
build:
Expand All @@ -16,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
node-version: [12.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -28,4 +24,8 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile
- run: yarn build
- run: yarn test
- run: yarn test --coverage
- name: Coverage Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github
*.ts
tsconfig*
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Coverage Status](https://coveralls.io/repos/github/nohmad/graql/badge.svg?branch=master)](https://coveralls.io/github/nohmad/graql?branch=master)

# Graql

graql is a light-weight graphql client depends on nothing but 'node-fetch'.
Expand Down
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fetch from 'node-fetch';

const APPLICATION_JSON = 'application/json';

interface Options {
interface FetchOptions {
method?: string,
headers?: {[key: string]: string},
body?: string,
Expand All @@ -18,9 +18,9 @@ class Graql {
endpoint: string;
headers: {[key: string]: string};
debug: boolean;
options: Options;
options: FetchOptions;

constructor(endpoint: string, options: Options = {debug: false}) {
constructor(endpoint: string, options: FetchOptions = {debug: false}) {
this.endpoint = endpoint;
this.debug = options.debug;
delete options.debug;
Expand All @@ -32,7 +32,7 @@ class Graql {
this.options = {method: 'POST', ...options};
}

async fetch(request: GraphqlRequest, options: Options = {}) {
async fetch(request: GraphqlRequest, options: FetchOptions = {}) {
const body = JSON.stringify(request);
const headers = {...this.headers, ...options.headers};
const _options = {...this.options, ...options, headers};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graql",
"version": "0.3.0",
"version": "0.3.4",
"author": "Gyoung-Yoon Noh <nohmad@gmail.com>",
"repository": {
"type": "git",
Expand Down
5 changes: 1 addition & 4 deletions tsconfig-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
"compilerOptions": {
"module": "CommonJS",
"outDir": "dist/cjs"
},
"exclude": [
"node_modules", "dist", "**/*.spec.ts"
]
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"module": "es2020",
"moduleResolution": "node",
"esModuleInterop": true,
"declaration": true,
"outDir": "dist/esm"
},
"exclude": [
Expand Down