Skip to content

Commit

Permalink
Bump ts-poet for dprint.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh committed Aug 26, 2022
1 parent fb6a1ca commit ca1bd68
Show file tree
Hide file tree
Showing 3 changed files with 3,739 additions and 2,877 deletions.
58 changes: 37 additions & 21 deletions integration/graphql-types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export type Scalars = {

export type Author = AuthorLike & {
__typename?: 'Author';
birthday?: Maybe<Scalars['Date']>;
name: Scalars['String'];
summary: AuthorSummary;
popularity: Popularity;
summary: AuthorSummary;
working?: Maybe<Working>;
birthday?: Maybe<Scalars['Date']>;
};

export type AuthorInput = {
Expand All @@ -34,9 +34,9 @@ export type AuthorLike = {

export type AuthorSummary = {
__typename?: 'AuthorSummary';
amountOfSales?: Maybe<Scalars['Float']>;
author: Author;
numberOfBooks: Scalars['Int'];
amountOfSales?: Maybe<Scalars['Float']>;
};

export type Book = {
Expand All @@ -62,16 +62,16 @@ export type MutationSaveAuthorLikeArgs = {
};

export enum Popularity {
Low = 'Low',
High = 'High'
High = 'High',
Low = 'Low'
}

export type Query = {
__typename?: 'Query';
authors: Array<Author>;
authorSummaries: Array<AuthorSummary>;
search: Array<SearchResult>;
authors: Array<Author>;
currentAuthor?: Maybe<Author>;
search: Array<SearchResult>;
};


Expand All @@ -97,8 +97,8 @@ export type SaveAuthorResult = {
export type SearchResult = Author | Book;

export enum Working {
Yes = 'YES',
No = 'NO'
No = 'NO',
Yes = 'YES'
}

export type GetAuthorSummariesQueryVariables = Exact<{ [key: string]: never; }>;
Expand Down Expand Up @@ -266,21 +266,21 @@ export type CurrentAuthorLazyQueryHookResult = ReturnType<typeof useCurrentAutho
export type CurrentAuthorQueryResult = Apollo.QueryResult<CurrentAuthorQuery, CurrentAuthorQueryVariables>;
export interface AuthorOptions {
__typename?: "Author";
birthday?: Author["birthday"];
name?: Author["name"];
summary?: AuthorSummaryOptions;
popularity?: Author["popularity"];
summary?: AuthorSummaryOptions;
working?: Author["working"];
birthday?: Author["birthday"];
}

export function newAuthor(options: AuthorOptions = {}, cache: Record<string, any> = {}): Author {
const o = (cache["Author"] = {} as Author);
o.__typename = "Author";
o.birthday = options.birthday ?? null;
o.name = options.name ?? "name";
o.popularity = options.popularity ?? Popularity.High;
o.summary = maybeNewAuthorSummary(options.summary, cache, options.hasOwnProperty("summary"));
o.popularity = options.popularity ?? Popularity.Low;
o.working = options.working ?? null;
o.birthday = options.birthday ?? null;
return o;
}

Expand All @@ -305,17 +305,17 @@ function maybeNewOrNullAuthor(value: AuthorOptions | undefined | null, cache: Re
}
export interface AuthorSummaryOptions {
__typename?: "AuthorSummary";
amountOfSales?: AuthorSummary["amountOfSales"];
author?: AuthorOptions;
numberOfBooks?: AuthorSummary["numberOfBooks"];
amountOfSales?: AuthorSummary["amountOfSales"];
}

export function newAuthorSummary(options: AuthorSummaryOptions = {}, cache: Record<string, any> = {}): AuthorSummary {
const o = (cache["AuthorSummary"] = {} as AuthorSummary);
o.__typename = "AuthorSummary";
o.amountOfSales = options.amountOfSales ?? null;
o.author = maybeNewAuthor(options.author, cache, options.hasOwnProperty("author"));
o.numberOfBooks = options.numberOfBooks ?? 0;
o.amountOfSales = options.amountOfSales ?? null;
return o;
}

Expand Down Expand Up @@ -506,7 +506,8 @@ interface GetAuthorSummariesDataOptions {
export function newGetAuthorSummariesData(data: GetAuthorSummariesDataOptions) {
return {
__typename: "Query" as const,
authorSummaries: data["authorSummaries"]?.map((d) => newAuthorSummary(d)) || [],
authorSummaries: data["authorSummaries"]?.map((d) => newAuthorSummary(d)) ||
[],
};
}

Expand All @@ -516,7 +517,11 @@ export function newGetAuthorSummariesResponse(
return {
request: { query: GetAuthorSummariesDocument },
// TODO Remove the any by having interfaces have a __typename that pacifies mutation type unions
result: { data: data instanceof Error ? undefined : (newGetAuthorSummariesData(data) as any) },
result: {
data: data instanceof Error
? undefined
: newGetAuthorSummariesData(data) as any,
},
error: data instanceof Error ? data : undefined,
};
}
Expand All @@ -538,7 +543,9 @@ export function newSaveAuthorResponse(
return {
request: { query: SaveAuthorDocument, variables },
// TODO Remove the any by having interfaces have a __typename that pacifies mutation type unions
result: { data: data instanceof Error ? undefined : (newSaveAuthorData(data) as any) },
result: {
data: data instanceof Error ? undefined : newSaveAuthorData(data) as any,
},
error: data instanceof Error ? data : undefined,
};
}
Expand All @@ -549,7 +556,8 @@ interface SaveAuthorLikeDataOptions {
export function newSaveAuthorLikeData(data: SaveAuthorLikeDataOptions) {
return {
__typename: "Mutation" as const,
saveAuthorLike: data["saveAuthorLike"]?.map((d) => maybeNewAuthorLike(d, {})) || [],
saveAuthorLike:
data["saveAuthorLike"]?.map((d) => maybeNewAuthorLike(d, {})) || [],
};
}

Expand All @@ -560,7 +568,11 @@ export function newSaveAuthorLikeResponse(
return {
request: { query: SaveAuthorLikeDocument, variables },
// TODO Remove the any by having interfaces have a __typename that pacifies mutation type unions
result: { data: data instanceof Error ? undefined : (newSaveAuthorLikeData(data) as any) },
result: {
data: data instanceof Error
? undefined
: newSaveAuthorLikeData(data) as any,
},
error: data instanceof Error ? data : undefined,
};
}
Expand All @@ -581,7 +593,11 @@ export function newCurrentAuthorResponse(
return {
request: { query: CurrentAuthorDocument },
// TODO Remove the any by having interfaces have a __typename that pacifies mutation type unions
result: { data: data instanceof Error ? undefined : (newCurrentAuthorData(data) as any) },
result: {
data: data instanceof Error
? undefined
: newCurrentAuthorData(data) as any,
},
error: data instanceof Error ? data : undefined,
};
}
Expand Down
Loading

0 comments on commit ca1bd68

Please sign in to comment.