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

Implement reusable operation signatures (operations as templates) #459

Closed
daviwil opened this issue Apr 19, 2022 · 0 comments · Fixed by #552
Closed

Implement reusable operation signatures (operations as templates) #459

daviwil opened this issue Apr 19, 2022 · 0 comments · Fixed by #552
Assignees
Milestone

Comments

@daviwil
Copy link
Contributor

daviwil commented Apr 19, 2022

It should be possible to use an existing operation as a template to define other operations, much like a model can be used as a template for other models. For example:

@autoRoute
@doc("Get a {name}", TResource)
@get
@readsResource(TResource)
op ResourceRead<TResource>(
  ...ResourceInstanceParameters<TResource>
): TResource | ErrorResponse;

model Widget {
  @key
  id: string;
  name: string;
}

op getWidget: ResourceRead<Widget>;

See the full approved proposal here: #217 (comment)

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 a pull request may close this issue.

3 participants