-
Notifications
You must be signed in to change notification settings - Fork 9
fix: use SITE_URL
for GraphQL endpoint instead of HOME_URL
#154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use SITE_URL
for GraphQL endpoint instead of HOME_URL
#154
Conversation
🦋 Changeset detectedLatest commit: d2a2a63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Pull Request Test Coverage Report for Build 14394092408Details
💛 - Coveralls |
@@ -374,7 +374,8 @@ class SnapWPConfigManager { | |||
*/ | |||
static getGraphqlUrl(): string { | |||
return generateGraphqlUrl( | |||
SnapWPConfigManager.getConfig().wpHomeUrl, | |||
SnapWPConfigManager.getConfig().wpSiteUrl || | |||
SnapWPConfigManager.getConfig().wpHomeUrl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wpSiteUrl already falls back to wpHomeUrl
.
SnapWPConfigManager.getConfig().wpHomeUrl, | |
SnapWPConfigManager.getConfig().wpSiteUrl, |
packages/query/codegen.ts
Outdated
@@ -13,7 +13,8 @@ const config: CodegenConfig = { | |||
schema: process.env.GRAPHQL_SCHEMA_FILE ?? [ | |||
{ | |||
[ generateGraphqlUrl( | |||
process.env.NEXT_PUBLIC_WP_HOME_URL, | |||
process.env.NEXT_PUBLIC_WP_SITE_URL || | |||
process.env.NEXT_PUBLIC_WP_HOME_URL, | |||
process.env.NEXT_PUBLIC_GRAPHQL_ENDPOINT | |||
) ]: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole things is getting too messy, and not just because I hate the generate()
function.
.changeset/cold-cows-joke.md
Outdated
"@snapwp/core": patch | ||
--- | ||
|
||
feat: use SITE_URL for GraphQL endpoint instead of HOME_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fix not a feature.
feat: use SITE_URL for GraphQL endpoint instead of HOME_URL | |
fix: use NEXT_PUBLIC_SITE_URL for GraphQL endpoint when available. |
SITE_URL
for GraphQL endpoint instead of HOME_URL
SITE_URL
for GraphQL endpoint instead of HOME_URL
What
This PR uses
SITE_URL
for GraphQL endpoint instead ofHOME_URL
Why
In a bedrock setup, the graphql server is at host:port/wp/graphql and host:port/wp is the WP SITE_URL whereas often the HOME_URL will be just host:port
Related Issue(s):
#149
How
Updated instances of generateGraphQLUrl() - passed SITE_URL instead of HOME_URL, per WPGraphQL’s logic.
Testing Instructions
Screenshots
Additional Info
Checklist
npm run changeset
.