-
Notifications
You must be signed in to change notification settings - Fork 134
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
[bugfix] Ensure consistent behaviour when using access token from session in GQL and REST clients #1772
base: main
Are you sure you want to change the base?
[bugfix] Ensure consistent behaviour when using access token from session in GQL and REST clients #1772
Changes from 6 commits
3ffa4b0
4413e97
ded10ed
54e6529
f6725a5
7470d92
709efd0
ca4791a
f9fb5a8
f9bf390
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,5 @@ | ||
--- | ||
'@shopify/shopify-api': minor | ||
--- | ||
|
||
[bugfix] Makes GQL client behavior on customn app config consistent with REST client |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,10 +53,16 @@ export class GraphqlClient { | |
logger(config).debug(message); | ||
} | ||
|
||
const customStoreAppAccessToken = | ||
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. I was a little confused on why this logic existed. config.apiSecretKey = The apps private key If we create a graphql client with the app private key, we would expect requests to fail. Seems like in the past we had told folks when setting up a merchant custom app to put the access token = config.apiSecretKey. And then later added the config.adminApiAccessToken. And this logic is to handle folks that never migrated. We could deprecate this logic, and require merchant custom apps to set both values. 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. yeah, indeed this has been deprecated ed71298#diff-3bfd67f947f1e7d5cca6fba729bd99512b17d76b16303b6d00b235e1fb6a9237R91-R96 I think we should take this opportunity to deprecate it for good |
||
config.adminApiAccessToken ?? config.apiSecretKey; | ||
|
||
this.session = params.session; | ||
this.apiVersion = params.apiVersion; | ||
|
||
this.client = createAdminApiClient({ | ||
accessToken: config.adminApiAccessToken ?? this.session.accessToken!, | ||
accessToken: config.isCustomStoreApp | ||
? customStoreAppAccessToken | ||
: this.session.accessToken!, | ||
apiVersion: this.apiVersion ?? config.apiVersion, | ||
storeDomain: this.session.shop, | ||
customFetchApi: abstractFetch, | ||
|
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 can be a patch