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

Migrate client API to codegen #174

Open
MichaelJamesParsons opened this issue Oct 20, 2019 · 0 comments
Open

Migrate client API to codegen #174

MichaelJamesParsons opened this issue Oct 20, 2019 · 0 comments
Labels
C-Chore Issues related to quality-of-life improvements

Comments

@MichaelJamesParsons
Copy link
Contributor

Description

The client app's API client is written by hand. Investigate what it would take to generate an API client from the routes defined the server app's routes.

Requirements/Expected Behavior

Generate an API client that is compatible with React Hooks. It should support the following use cases

Note: The API doesn't necessarily have to be consistent with the examples below.

Call directly from useEffect()

export function MyComponent() {
  useEffect(() => {
      makeTitanApiRequest(ListFileEntryTypes)
        .then(/* do something */);
  });
  return (...);
}

Wrap as a React hook

const fetchUsers = useTitanApiClient(ListOrganizationUsersRequest,
    { orgId: props.organizationId });
@MichaelJamesParsons MichaelJamesParsons added the C-Chore Issues related to quality-of-life improvements label Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Chore Issues related to quality-of-life improvements
Projects
None yet
Development

No branches or pull requests

1 participant