Skip to content
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

ADS-4220 Add support for search requests #357

Merged
merged 13 commits into from
Nov 23, 2023

Conversation

TobiasGraml11
Copy link
Contributor

@TobiasGraml11 TobiasGraml11 commented Oct 19, 2023

Description

https://nostosolutions.atlassian.net/browse/ADS-4193
https://nostosolutions.atlassian.net/browse/ADS-4194

Related Issue

Motivation and Context

How Has This Been Tested?

Documentation:

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • I have assigned the correct milestone or created one if non-existent.
  • I have correctly labeled this pull request.
  • I have linked the corresponding issue in this description.
  • I have updated the corresponding Jira ticket.
  • I have requested a review from at least 2 reviewers
  • I have checked the base branch of this pull request
  • I have checked my code for any possible security vulnerabilities

@TobiasGraml11 TobiasGraml11 self-assigned this Oct 19, 2023
@TobiasGraml11 TobiasGraml11 marked this pull request as draft October 19, 2023 11:51
@TobiasGraml11 TobiasGraml11 marked this pull request as ready for review November 2, 2023 11:50
Copy link
Member

@supercid supercid left a comment

Choose a reason for hiding this comment

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

Do we really need to dump the whole GraphQL response in the objects here?
Please review what you can re-use and what will actually be used from the responses.
You already have Types/Product, and I'm not sure why would you need the whole Hit/ namespace.

@TobiasGraml11
Copy link
Contributor Author

TobiasGraml11 commented Nov 6, 2023

@supercid

Do we really need to dump the whole GraphQL response in the objects here?

I just think it makes sense to move everything to the classes, because then you have autocompletion when trying to access it. If it's just one big stdclass, you always need to check the response. But it would also be possible to just use public member variables, so at least the getters are not needed.

Please review what you can re-use and what will actually be used from the responses.

You mean, like Product extending Sku? And you only want to create the classes, for what I use within the plugin?

You already have Types/Product, and I'm not sure why would you need the whole Hit/ namespace

Did not see this type files before. But some points:

  • Not sure why this is an interface, so it's not really usable for this case. It needs to be implemented to be useable.
  • Seems like this type is specially for the Product Update. The update request has different data than the search results.
  • Hit/ is there for the same reason as above, to have some autocompletion. Wanted to structure it, instead of having everything in one folder. Naming is just based on the response.

src/Operation/SearchRequest.php Outdated Show resolved Hide resolved
src/Util/GraphQL.php Outdated Show resolved Hide resolved
@TobiasGraml11 TobiasGraml11 merged commit 5584266 into develop Nov 23, 2023
7 checks passed
@TobiasGraml11 TobiasGraml11 deleted the add_support_for_search_api branch November 23, 2023 13:21
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.

3 participants