-
Notifications
You must be signed in to change notification settings - Fork 10.3k
feat(gatsby-source-wordpress): support multiple instances of plugin #38119
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
Changes from all commits
403ab15
c8675f2
cd7ab4d
91fe6d2
40b68b1
e21d798
47140cd
dba2307
dbb17e5
1bb174f
7dce814
feebdaa
381e40b
9c49d82
29dd03e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* | ||
* @param {Object} options | ||
* @param {string} options.url | ||
* @param {string} options.query | ||
* @param {Object} options.variables | ||
* @param {Object} options.headers | ||
* | ||
* @returns {Promise<Object>} | ||
*/ | ||
exports.fetchGraphql = async ({ url, query, variables = {}, headers = {} }) => { | ||
const response = await fetch(url, { | ||
method: `POST`, | ||
headers: { | ||
"Content-Type": `application/json`, | ||
...headers, | ||
}, | ||
body: JSON.stringify({ | ||
query, | ||
variables, | ||
}), | ||
}) | ||
const data = await response.json() | ||
if (data.errors) { | ||
throw new Error(JSON.stringify(data.errors)) | ||
} | ||
return data | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ | |
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.13", | ||
"@rematch/core": "^1.4.0", | ||
"@rematch/immer": "^1.2.0", | ||
"@rematch/core": "^2.2.0", | ||
"@rematch/immer": "^2.1.3", | ||
Comment on lines
-11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old version of rematch had completely broken TS types There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! it did indeed. I looked at upgrading around a year ago and went through the whole process only to discover rematch was no longer working and I didn't have more time to figure out why 🤦 hopefully you fared better here! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good thing is, while they're odd, the tests are fairly comprehensive, so if there's any problem it'll definitely show up in the tests |
||
"async-retry": "^1.3.3", | ||
"atob": "^2.1.2", | ||
"axios": "^0.21.1", | ||
|
@@ -33,6 +33,7 @@ | |
"gatsby-source-filesystem": "^5.11.0-next.1", | ||
"glob": "^7.2.3", | ||
"got": "^11.8.6", | ||
"immer": "^9.0.0", | ||
"json-diff": "^1.0.6", | ||
"lodash": "^4.17.21", | ||
"node-fetch": "^2.6.11", | ||
|
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.
Same signature as the one we were previously importing from the plugin