Skip to content

Commit

Permalink
fix: sanitize base path
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Mar 14, 2024
1 parent 4750415 commit f6c7a06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/RelayEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
Store,
} from "relay-runtime";

const graphQLPath = window.Config.basename + "graphql";
function getSanitizedPath(path: string): string {
return path.endsWith("/") ? path.slice(0, -1) : path;
}
const graphQLPath = getSanitizedPath(window.Config.basename) + "/graphql";
/**
* Relay requires developers to configure a "fetch" function that tells Relay how to load
* the results of GraphQL queries from your server (or other data source). See more at
Expand Down

0 comments on commit f6c7a06

Please sign in to comment.