A
Alokaiβ€’12mo 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β€’12mo ago
Hi @.darrenr πŸ‘‹ , I'll ask our engineers. I'm not sure.
Darren R
Darren Rβ€’12mo 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β€’12mo ago
Not yet, I'll bring it up in the daily and try to get an answer.
Darren R
Darren Rβ€’12mo ago
@rohrig Thanks.
rohrig
rohrigβ€’12mo 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β€’12mo 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β€’12mo 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β€’12mo 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β€’12mo 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β€’12mo ago
@rohrig That's great, thank you πŸ˜ƒ Hi @rohrig Just checking in on this one?
rohrig
rohrigβ€’12mo 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β€’12mo 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β€’12mo ago
will do @Darren R it may be faster for you to create a PR in this case. πŸ˜„
Darren R
Darren Rβ€’12mo 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β€’11mo ago
Hi @rohrig Any idea when this will be reviewed and released? This issue is critical for us now.
Want results from more Discord servers?
Add your server