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

feat(openapi-tooling): allow creating a react query layer on top of the generated client #24487

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

aramissennyeydd
Copy link
Contributor

Hey, I just made a Pull Request!

What's better than 1 level of generated code? ⭐ 😎 ⭐

The goal of this PR is to demonstrate the viability of automatically generating react use hooks that can be used directly in code without having to instantiate the generated client. Most of that work is being done in plugins/catalog-react/src/generated/apis/DefaultApi.query.ts. Users should be able to immediately import the react query hook and get started writing UI components -- no need to worry about the API layer at all. Some parts of it leak out, as the request object has body, query, path keys, but I think that's fine for now. These hooks can be wrapped again if desired or overridden.

TODO:

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@github-actions github-actions bot added the area:catalog Related to the Catalog Project Area label Apr 24, 2024
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Apr 24, 2024

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @backstage/catalog-client
  • @backstage/repo-tools
  • @backstage/plugin-catalog-backend
  • @backstage/plugin-catalog-react

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/catalog-client packages/catalog-client none v1.6.5
@backstage/repo-tools packages/repo-tools none v0.9.4-next.1
@backstage/plugin-catalog-backend plugins/catalog-backend none v1.24.0-next.1
@backstage/plugin-catalog-react plugins/catalog-react none v1.12.2-next.2

Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Jun 12, 2024
@aramissennyeydd
Copy link
Contributor Author

Looks like some conflicts crept in, I'll take a look at those this week.

@github-actions github-actions bot removed the stale label Jun 12, 2024
@Rugvip
Copy link
Member

Rugvip commented Jun 12, 2024

Oh I hadn't seen this, interesting! Is it ready for review?

@aramissennyeydd
Copy link
Contributor Author

@Rugvip It's close, I'm trying to get some feedback internally around this. #23610 is ready for a re-review though :)

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Copy link
Contributor

github-actions bot commented Jul 2, 2024

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Jul 2, 2024
@github-actions github-actions bot closed this Jul 9, 2024
@github-actions github-actions bot removed the stale label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:catalog Related to the Catalog Project Area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants