Skip to content

chore: adds profile query basic structure - #2744

Merged
hellofanny merged 3 commits into
mainfrom
chore/profile-query-api
Mar 25, 2025
Merged

hellofanny merged 3 commits into
mainfrom
chore/profile-query-api

Conversation

@hellofanny

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

We will need to update the faststore/api with profile.
To avoid conflicts and potential issues, since multiple feature branches will be using the same core, I'm extracting part of the logic introduced in #2739 into the main branch.

How it works?

Adds profile's type and profile to query.

How to test it?

The easiest way to test might be running the faststore/api and faststore/core

image image

@hellofanny hellofanny changed the title Chore: Adds profile query basic structure chore: adds profile query basic structure Mar 24, 2025
@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@hellofanny
hellofanny marked this pull request as ready for review March 24, 2025 22:30
@hellofanny
hellofanny requested a review from a team as a code owner March 24, 2025 22:30
@hellofanny
hellofanny requested review from lucasfp13, pedromtec, renatamottam and renatomaurovtex and removed request for a team, renatamottam and renatomaurovtex March 24, 2025 22:30
clients: { commerce },
} = ctx

const addresses = await commerce.profile.addresses(id)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think we should handle errors (try catch) if id didn't exist, for example? or did the Profile API already do?

@lucasfp13 lucasfp13 Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

id here will always exist ensured by the query property that set it as required (see QueryProfileArgs input type). If the param is not sent, the GraphQL layer will probably throw an error before the execution, @hellofanny you can just reproduce this scenario to validate the behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's right! The graphQl will throw an error 👍
image

@hellofanny hellofanny self-assigned this Mar 25, 2025
@hellofanny
hellofanny merged commit f1fa275 into main Mar 25, 2025
@hellofanny
hellofanny deleted the chore/profile-query-api branch March 25, 2025 14:18
@lucasfp13 lucasfp13 mentioned this pull request Apr 22, 2025
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.

5 participants