Skip to content

Commit

Permalink
Use env variable instead of config file
Browse files Browse the repository at this point in the history
  • Loading branch information
juffalow committed Apr 25, 2022
1 parent f6b6e11 commit adf6a5d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_GRAPHQL_URL=https://graphql.juffalow.com/graphql
3 changes: 0 additions & 3 deletions src/config.example.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import {
} from 'relay-runtime';
import { RequestParameters } from 'relay-runtime/lib/util/RelayConcreteNode';
import { Variables } from 'relay-runtime/lib/util/RelayRuntimeTypes';
import config from './config';

async function fetchGraphQL(params: RequestParameters, variables: Variables) {
const response = await fetch(config.graphql, {
const response = await fetch(`${process.env.REACT_APP_GRAPHQL_URL}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down

0 comments on commit adf6a5d

Please sign in to comment.