-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: add refunds GraphQL query #5352
Conversation
Signed-off-by: Erik Kieckhafer <[email protected]> (cherry picked from commit 77d8b75)
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]> (cherry picked from commit 938b458)
@aldeed I wasn't sure if this should go into What do you think about it's location? |
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@kieckhafer I think I have the same thoughts as you, could go either place. Since payments are currently coupled with orders, leaving it in orders seems fine. I'm assigning @focusaurus to do the full code review here, but my only comment is that for GraphQL, we try to omit words like Also keep in mind that something like this fits pretty well into the payment resolver. In other words, rather than (or in addition to) {
order {
payments {
refunds {
amount
}
}
}
} Or for a combined list for all payments, it could be similarly done as |
…stRefundsGQLQuery
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
imports/plugins/core/orders/server/no-meteor/queries/refunds.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/resolvers/Refund/createdAt.js
Show resolved
Hide resolved
imports/plugins/included/marketplace/server/no-meteor/util/stripeListRefunds.js
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
…stRefundsGQLQuery
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@focusaurus I added a new query here,
|
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
imports/plugins/core/orders/server/no-meteor/resolvers/Order/payments.js
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
imports/plugins/core/orders/server/no-meteor/resolvers/Query/refundsByPaymentId.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
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.
@kieckhafer A few last comments
imports/plugins/core/orders/server/no-meteor/resolvers/Refund/createdAt.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/resolvers/Refund/index.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/resolvers/Refund/index.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/schemas/schema.graphql
Outdated
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed comments addressed, ready for a final look |
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Part of #5158
Impact: minor
Type: feature
A new
listRefunds
query allows you to query refunds of payments on a particular order. This was previously a meteor only method. The meteor method will be removed with #5158.Breaking changes
None
Testing
listRefunds
query to see the refundsI've added tests here to test the permission / requirements of variables, but did not add tests to check a result, as the payment method has it's own tests for this element: https://github.com/reactioncommerce/reaction/blob/feat-kieckhafer-listRefundsGQLQuery/imports/plugins/included/payments-stripe/server/no-meteor/util/stripeListRefunds.test.js#L10