Skip to content

Commit

Permalink
fix: gql endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardocasares committed Oct 28, 2020
1 parent a5d15f8 commit f9629e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/graphql/gqless/client.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Client, QueryFetcher } from "gqless";
import { schema, Query } from "./generated";

const endpoint = "http://localhost:3000/api/graphql";
const endpoint = process.env.GQL_ENDPOINT;

const fetchQuery: QueryFetcher = async (query, variables) => {
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json"
"Content-Type": "application/json",
},
body: JSON.stringify({
query,
variables
variables,
}),
mode: "cors"
mode: "cors",
});

if (!response.ok) {
Expand Down

0 comments on commit f9629e5

Please sign in to comment.