Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Oct 4, 2019

Resolves parts of #5679
Impact: minor
Type: feature|refactor

Issue

As part of our effort to demeteorize the app, we need to convert remaining meteor methods to GQL mutations / queries.

Solution

This PR adds the following mutation: archiveProducts

This PR removes the following meteor methods: products/archiveProduct & products/deleteVariant

Instead of creating a second mutation to clone the products/deleteVariant meteor method, I've adjusted archiveProducts to accept both products and variants as input.

Notes

Should this be renamed archiveProductsOrVariants, since it can do both?

Breaking changes

Any custom code using any of the above meteor methods will need to be refactored to use the new GQL methods.

Testing

  1. Start the app.
  2. See that you can preform the following actions:
  • Archive a product
  • Archive a variant

@kieckhafer kieckhafer marked this pull request as ready for review October 4, 2019 21:04
@kieckhafer
Copy link
Member Author

This is a client and server side update. @mikemurray can you please make sure all the client side archiving works as it should.

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI archive buttons look good

Copy link
Contributor

@aldeed aldeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. What do you think about making an archiveProductVariants GraphQL mutation, but in it just call the same archiveProducts internal mutation? For now they'd be identical but it would allow us to change them behind the scenes later.

@kieckhafer
Copy link
Member Author

@aldeed comments addressed, new archiveProductVariants added

Signed-off-by: Erik Kieckhafer <[email protected]>
@kieckhafer kieckhafer changed the title refactor: create GQL mutations to replace Catalog meteor methods refactor: create archiveProducts GQL mutations to replace meteor methods Oct 7, 2019
@kieckhafer kieckhafer changed the title refactor: create archiveProducts GQL mutations to replace meteor methods refactor: create archiveProducts GQL mutation to replace meteor methods Oct 7, 2019
Copy link
Contributor

@aldeed aldeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kieckhafer When I run the new test locally, I see Mutation.archiveProducts defined in resolvers, but not in schema. I don't know why because it's in the schema file and all the necessary imports seem to be there. But maybe that's a clue as to why the memory error?

The rest of this code LGTM

@aldeed
Copy link
Contributor

aldeed commented Oct 7, 2019

@kieckhafer Also make sure all testApp.stop(); calls in integration tests are either await or are returned by the afterAll function. It didn't used to be necessary but after some recent changes I made, they should be awaited to avoid uncaught errors in that promise.

@kieckhafer
Copy link
Member Author

@aldeed I updated all the testApp.stop() to use await, but I did not see the Mutation.archiveProducts defined in resolvers, but not in schema when running tests locally. (and i also see it in the schema)

@aldeed aldeed merged commit 7a6bbf8 into develop Oct 8, 2019
@aldeed aldeed deleted the refactor-kieckhafer-convertCatalogMethodsToGQL branch October 8, 2019 20:22
@willopez willopez mentioned this pull request Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants