Skip to content

Commit 03ca00a

Browse files
committed
chore: SHOULD_LOG_API_URL
1 parent f44df52 commit 03ca00a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/ghost-graphql/src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export const API_VERSION = process.env.GHOST_API_VERSION || 'v3';
33
export const API_URL =
44
process.env.GHOST_API_URL ||
55
`${process.env.GHOST_URL}/ghost/api/${API_VERSION}/content`;
6+
export const SHOULD_LOG_API_URL =
7+
process.env.GHOST_SHOULD_LOG_API_URL === 'true';

packages/ghost-graphql/src/datasources/resource.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RESTDataSource } from 'apollo-datasource-rest';
2-
import { API_KEY, API_URL } from '../constants';
2+
import { API_KEY, API_URL, SHOULD_LOG_API_URL } from '../constants';
33
import BrowseArgumentsInterface from '../interfaces/BrowseArguments';
44
import ReadArgumentsInterface from '../interfaces/ReadArguments';
55
import getBrowseArguments from '../helpers/getBrowseArguments';
@@ -8,6 +8,9 @@ export default class ResourceDataSource extends RESTDataSource {
88
constructor() {
99
super();
1010
this.baseURL = `${API_URL}`;
11+
if (SHOULD_LOG_API_URL) {
12+
console.log('API_URL', API_URL);
13+
}
1114
}
1215

1316
browse(browseArguments: BrowseArgumentsInterface) {

0 commit comments

Comments
 (0)