Skip to content
Open
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@
]
},
"dependencies": {
"@types/isomorphic-fetch": "^0.0.36",
"graphql": "^15.4.0",
"graphql-request": "^3.4.0",
"isomorphic-fetch": "^3.0.0"
"graphql-request": "^3.4.0"
},
"ava": {
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {GraphQLClient} from 'graphql-request';
import fetch from 'isomorphic-fetch';
import {fetch as crossFetch} from 'cross-fetch';
Comment thread
njerig marked this conversation as resolved.
import {autocompleteSchoolQuery, searchTeacherQuery, getTeacherQuery} from './queries';
import {AUTH_TOKEN} from './constants';

const client = new GraphQLClient('https://www.ratemyprofessors.com/graphql', {
headers: {
authorization: `Basic ${AUTH_TOKEN}`
},
fetch
fetch: globalThis.fetch ?? crossFetch
});

export interface ISchoolFromSearch {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"lib": ["ES2017", "DOM"],
"lib": ["ES2017"],
"target": "es6",
"module": "commonjs",
"declaration": true,
Expand Down
Loading