Skip to content

Commit dbbf15c

Browse files
authored
fix: Fix incorrect getSchemas type (#219)
fixing readme and schema type
1 parent a57ddf2 commit dbbf15c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ You can generate schema types for your own workspace with [@ftrack/ts-schema-gen
4141
Once generated, you can integrate them with @ftrack/api by passing them as a type variable:
4242

4343
```ts
44-
import SchemaTypes from "./__generated__/schema.ts";
44+
import { EntityTypeMap } from "./__generated__/schema.ts";
4545
import { Session } from "@ftrack/api";
4646

47-
const session = new Session<SchemaTypes>(...);
47+
const session = new Session<EntityTypeMap>(...);
4848

4949
// user will now be of type User
5050
// and provide all available properties for its entity type.

source/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export class Session<
594594
* This is cached after the first call, and assumes that the schemas will not change during the session.
595595
* @returns Promise with the API schemas for the session.
596596
*/
597-
async getSchemas(): Promise<Schema<TEntityTypeMap[keyof TEntityTypeMap]>[]> {
597+
async getSchemas(): Promise<Schema<TEntityTypeMap>[]> {
598598
if (!this.schemasPromise) {
599599
this.schemasPromise = this.call<QuerySchemasResponse<TEntityTypeMap>>([
600600
{ action: "query_schemas" },

0 commit comments

Comments
 (0)