-
Notifications
You must be signed in to change notification settings - Fork 162
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
Refactor store fetch, remove dead code #5597
base: ensure-dev-store-access
Are you sure you want to change the base?
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success2173 tests passing in 953 suites. Report generated by 🧪jest coverage report action from 4b88cc9 |
We detected some changes at packages/*/src and there are no updates in the .changeset. |
@@ -1432,7 +1432,7 @@ export function testDeveloperPlatformClient(stubs: Partial<DeveloperPlatformClie | |||
Promise.resolve({organization: testOrganization(), apps: [testOrganizationApp()], hasMorePages: false}), | |||
createApp: (_organization: Organization, _options: CreateAppOptions) => Promise.resolve(testOrganizationApp()), | |||
devStoresForOrg: (_organizationId: string) => Promise.resolve({stores: [], hasMorePages: false}), | |||
storeByDomain: (_orgId: string, _shopDomain: string) => Promise.resolve({organizations: {nodes: []}}), | |||
storeByDomain: (_orgId: string, _shopDomain: string) => Promise.resolve(undefined), |
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.
Any reason we are explicitly passing undefined?
storeByDomain: (_orgId: string, _shopDomain: string) => Promise.resolve(undefined), | |
storeByDomain: (_orgId: string, _shopDomain: string) => Promise.resolve(), |
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.
Nope, thanks for catching this.
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.
Apparently it needs to be undefined
. The suggested change causes this error:
Type '(_orgId: string, _shopDomain: string) => Promise<void>' is not assignable to type '(orgId: string, shopDomain: string) => Promise<OrganizationStore | undefined>'.
Type 'Promise<void>' is not assignable to type 'Promise<OrganizationStore | undefined>'.
Type 'void' is not assignable to type 'OrganizationStore | undefined'.ts(2322)
4396abf
to
fd5b2a9
Compare
a2eab52
to
4b88cc9
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/api/business-platform.d.ts@@ -40,6 +40,6 @@ export declare function businessPlatformOrganizationsRequest<T>(query: string, t
* @param variables - GraphQL variables to pass to the query.
* @returns The response of the query of generic type <T>.
*/
-export declare function businessPlatformOrganizationsRequestDoc<TResult>(query: TypedDocumentNode<TResult, GraphQLVariables> | TypedDocumentNode<TResult, Exact<{
+export declare function businessPlatformOrganizationsRequestDoc<TResult, TVariables extends Variables>(query: TypedDocumentNode<TResult, TVariables> | TypedDocumentNode<TResult, Exact<{
[key: string]: never;
-}>>, token: string, organizationId: string, variables?: GraphQLVariables): Promise<TResult>;
\ No newline at end of file
+}>>, token: string, organizationId: string, variables?: TVariables): Promise<TResult>;
\ No newline at end of file
|
WHY are these changes introduced?
Refactors store fetching code and removes dead code to simplify future changes.
WHAT is this pull request doing?
fetchStoreByDomain
is no longer used and is removed in this PR.This also allows the developer platform client interface to be simplified. Its
storeByDomain
method can then return anOrganizationStore
instead of a GraphQL result.This change paves the way for changes to
OrganizationStore
that are not coupled to underlying GraphQL.How to test your changes?
Unit tests are sufficient here. The entire PR stack can be tophatted using the instructions here.
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist