Skip to content

Commit

Permalink
Merge pull request #11 from nrccua/feature/rest_type_helpers
Browse files Browse the repository at this point in the history
[E4E-58]: Add helper rest type extractors
  • Loading branch information
TheCleric authored Dec 8, 2021
2 parents 239ebd2 + e8bf334 commit d0335a5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.2.1](https://github.com/nrccua/apollo-rest-utils/compare/1.2.0...1.2.1) (2021-12-08)


### Changes

* [E4E-58]: Add helper rest type extractors ([fc0fbad](https://github.com/nrccua/apollo-rest-utils/commit/fc0fbad7435a5217ade6857bd6be006bfd8e000a))
* Merge pull request #9 from nrccua/feature/headersLink ([239ebd2](https://github.com/nrccua/apollo-rest-utils/commit/239ebd21ad8666851ad673e6e5203bb315db5a02)), closes [#9](https://github.com/nrccua/apollo-rest-utils/issues/9)
* [E4E-0]: 1.2.0 ([ebc7c39](https://github.com/nrccua/apollo-rest-utils/commit/ebc7c39cfc44ec99fa92ef274f85a0b4ff3b39dc))

## [1.2.0](https://github.com/nrccua/apollo-rest-utils/compare/1.1.1...1.2.0) (2021-12-06)


Expand Down
1 change: 1 addition & 0 deletions lib/HeadersLink/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NextLink, Operation } from '@apollo/client';

import HeadersLink from '.';

describe('HeadersLink', () => {
Expand Down
4 changes: 4 additions & 0 deletions lib/types/restSchema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export interface IRestEndpoint<ResponseType, RequestType = unknown> {
responseSchema: RestEndpointSchema;
}

export type RestResponse<T> = T extends IRestEndpoint<infer U, unknown> ? U : never;

export type RestRequest<T> = T extends IRestEndpoint<unknown, infer U> ? U : never;

export type Input<T> = T | { input: T };

export interface IEndpointOptions<T, U> {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
"update:version:major": "standard-version --release-as major",
"update:version:minor": "standard-version --release-as minor"
},
"version": "1.2.0"
"version": "1.2.1"
}

0 comments on commit d0335a5

Please sign in to comment.