A
Alokaiβ€’14mo ago
Darren R

generateCustomerToken api has customQuery param missing in the latest version

We have upgraded a project to the latest version of the magento-api and it has broken some of our functionality. On investigation, it appears that the CustomQuery parameter has been removed from the generateCustomerToken api. https://github.com/vuestorefront/magento2/blob/main/packages/api-client/src/api/generateCustomerToken/index.ts Is there a reason this has been removed or was it an error (perhaps made when customHeaders was added)?
GitHub
magento2/packages/api-client/src/api/generateCustomerToken/index.ts...
Vue Storefront 2 integration for Magento 2. Contribute to vuestorefront/magento2 development by creating an account on GitHub.
17 Replies
rohrig
rohrigβ€’14mo ago
Hi @.darrenr πŸ‘‹ , I'll ask our engineers. I'm not sure.
Darren R
Darren Rβ€’14mo ago
Hi @.rohrig thanks for looking into this. I’m pretty sure it should still be there, but will await your feedback. Hey @rohrig Any updates on this?
rohrig
rohrigβ€’14mo ago
Not yet, I'll bring it up in the daily and try to get an answer.
Darren R
Darren Rβ€’14mo ago
@rohrig Thanks.
rohrig
rohrigβ€’14mo ago
Hi @Darren R πŸ‘‹ , Here's the answer I got. generateCustomerToken mutation returns nothing more but the token so our endpoint covers 100% of this method and there is no need for a custom query as you can’t effectively change the shape of the response.
Darren R
Darren Rβ€’14mo ago
This is not correct. We have changed what this endpoint returns in the back end. We are using a Single Sign On Integration and on the generateCustomerToken mutation we passed a custom query so we could retrieve additional fields. This was all working perfectly until we updated to the latest magento-api as you have removed the customQuery parameter from the middleware (although in all the actual composables it is still a valid parameter) Isn't that the whole point of being able to add custom queries, and why they were added to all the magento-apis?
rohrig
rohrigβ€’14mo ago
Yes, I will forward this message and get back to you asap. πŸ˜ƒ I'll push to get this upgraded to include the CustomQuery but I'm not sure how long it will take. I'll let you know as soon as I know.
Darren R
Darren Rβ€’14mo ago
Appreciate that. Hopefully, it's soon as we are stuck at the minute. We had to upgrade to get Node 18 support, but now a core piece of our site functionality does not work.
rohrig
rohrigβ€’14mo ago
HI @Darren R πŸ‘‹ , we have the task to readd the CustomQuery assigned now. I think it should be ready some time next week. I can' t give you an exact date but I can assure you it will be done.
Darren R
Darren Rβ€’14mo ago
@rohrig That's great, thank you πŸ˜ƒ Hi @rohrig Just checking in on this one?
rohrig
rohrigβ€’13mo ago
It's in review now πŸ˜„ Hi @Darren R πŸ‘‹ , 2.4.0 for the magento-api is released. We're having an issue with our doc deployment so the change log isn't visible yet. But the issue is fixed in this version.
Darren R
Darren Rβ€’13mo ago
Hi @rohrig Although the code has been updated, the code is still not correct and passing Custom Queries does not work. If you look at the update: https://github.com/vuestorefront/magento2/commit/992734bf6221d236a349a404ddb98c0eb890345c On line 51:
mutation: gql`
${generateCustomerToken}
`,
mutation: gql`
${generateCustomerToken}
`,
This isn't passing the custom query, I think it should be:
mutation: gql`
${generateCustomerTokenGQL.query}
`,
mutation: gql`
${generateCustomerTokenGQL.query}
`,
I have tested this by overwriting the file locally. Can you get the team to look at this please?
rohrig
rohrigβ€’13mo ago
will do @Darren R it may be faster for you to create a PR in this case. πŸ˜„
Darren R
Darren Rβ€’13mo ago
GitHub
fix: add the custom query to mutation (#1469) by readio Β· Pull Requ...
πŸ”— Linked issue Fixes this: #1469 ❓ Type of change πŸ“– Documentation (updates to the documentation, readme or JSDoc annotations) 🐞 Bug fix (a non-breaking change that fixes an issue) πŸ‘Œ Enhancemen...
Darren R
Darren Rβ€’13mo ago
Hi @rohrig Any idea when this will be reviewed and released? This issue is critical for us now.
rohrig
rohrigβ€’13mo ago
I pushed internally. I'll keep you updated πŸ™‚ @Darren R 2.4.1 is now released πŸ˜„
Darren R
Darren Rβ€’13mo ago
@rohrig That's great, thanks!
Want results from more Discord servers?
Add your server