Skip to content

Commit dfec667

Browse files
authored
chore: update node version to 14 (#6)
1 parent 4275dee commit dfec667

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12-alpine as build
1+
FROM node:14-alpine as build
22

33
RUN apk add python make g++
44
WORKDIR /app
@@ -13,7 +13,7 @@ RUN npm run build && if [[ "$nodeEnv" == "production" ]]; then mv node_modules/n
1313
# Used just for tests
1414
ENTRYPOINT [ "npm", "run" ]
1515

16-
FROM node:12-alpine
16+
FROM node:14-alpine
1717
ENV NODE_ENV production
1818
RUN adduser app -h /app -D
1919
USER app

src/dgraph.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import fetch from 'node-fetch';
22
import { GraphQLResponse, AuthHeaderField } from '@slash-graphql/lambda-types';
33

44
export async function graphql(query: string, variables: Record<string, any> = {}, authHeader: AuthHeaderField): Promise<GraphQLResponse> {
5-
const headers: Record<string,string> = { "Content-Type": "application/json" };
6-
if(authHeader && authHeader.key && authHeader.value) {
5+
const headers: Record<string, string> = { "Content-Type": "application/json" };
6+
if (authHeader && authHeader.key && authHeader.value) {
77
headers[authHeader.key] = headers[authHeader.value];
88
}
99
const response = await fetch(`${process.env.DGRAPH_URL}/graphql`, {
1010
method: "POST",
1111
headers,
12-
body: JSON.stringify({query, variables})
12+
body: JSON.stringify({ query, variables })
1313
})
14-
if(response.status !== 200) {
14+
if (response.status !== 200) {
1515
throw new Error("Failed to execute GraphQL Query")
1616
}
1717
return response.json();
@@ -36,7 +36,7 @@ async function dqlMutate(mutate: string): Promise<GraphQLResponse> {
3636
const response = await fetch(`${process.env.DGRAPH_URL}/mutate?commitNow=true`, {
3737
method: "POST",
3838
headers: {
39-
"Content-Type": "pplication/rdf",
39+
"Content-Type": "application/rdf",
4040
"X-Auth-Token": process.env.DGRAPH_TOKEN || ""
4141
},
4242
body: mutate

0 commit comments

Comments
 (0)