Skip to content

Commit f4f6ed0

Browse files
committed
added generated types
1 parent d73295a commit f4f6ed0

4 files changed

+339
-0
lines changed

dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,50 @@ export type Scalars = {
1212
Float: number;
1313
};
1414

15+
/** A comment about an entry, submitted by a user */
16+
export type Comment = {
17+
__typename?: 'Comment';
18+
/** The text of the comment */
19+
content: Scalars['String'];
20+
/** A timestamp of when the comment was posted */
21+
createdAt: Scalars['Float'];
22+
/** The SQL ID of this entry */
23+
id: Scalars['Int'];
24+
/** The GitHub user who posted the comment */
25+
postedBy: User;
26+
/** The repository which this comment is about */
27+
repoName: Scalars['String'];
28+
};
29+
30+
/** Information about a GitHub repository submitted to GitHunt */
31+
export type Entry = {
32+
__typename?: 'Entry';
33+
/** The number of comments posted about this repository */
34+
commentCount: Scalars['Int'];
35+
/** Comments posted about this repository */
36+
comments: Array<Maybe<Comment>>;
37+
/** A timestamp of when the entry was submitted */
38+
createdAt: Scalars['Float'];
39+
/** The hot score of this repository */
40+
hotScore: Scalars['Float'];
41+
/** The SQL ID of this entry */
42+
id: Scalars['Int'];
43+
/** The GitHub user who submitted this entry */
44+
postedBy: User;
45+
/** Information about the repository from GitHub */
46+
repository: Repository;
47+
/** The score of this repository, upvotes - downvotes */
48+
score: Scalars['Int'];
49+
/** XXX to be changed */
50+
vote: Vote;
51+
};
52+
53+
/** Information about a GitHub repository submitted to GitHunt */
54+
export type EntryCommentsArgs = {
55+
limit?: InputMaybe<Scalars['Int']>;
56+
offset?: InputMaybe<Scalars['Int']>;
57+
};
58+
1559
/** A list of options for the sort order of the feed */
1660
export enum FeedType {
1761
/** Sort by a combination of freshness and score, using Reddit's algorithm */
@@ -22,6 +66,99 @@ export enum FeedType {
2266
Top = 'TOP',
2367
}
2468

69+
export type Mutation = {
70+
__typename?: 'Mutation';
71+
/** Comment on a repository, returns the new comment */
72+
submitComment?: Maybe<Comment>;
73+
/** Submit a new repository, returns the new submission */
74+
submitRepository?: Maybe<Entry>;
75+
/** Vote on a repository submission, returns the submission that was voted on */
76+
vote?: Maybe<Entry>;
77+
};
78+
79+
export type MutationSubmitCommentArgs = {
80+
commentContent: Scalars['String'];
81+
repoFullName: Scalars['String'];
82+
};
83+
84+
export type MutationSubmitRepositoryArgs = {
85+
repoFullName: Scalars['String'];
86+
};
87+
88+
export type MutationVoteArgs = {
89+
repoFullName: Scalars['String'];
90+
type: VoteType;
91+
};
92+
93+
export type Query = {
94+
__typename?: 'Query';
95+
/** Return the currently logged in user, or null if nobody is logged in */
96+
currentUser?: Maybe<User>;
97+
/** A single entry */
98+
entry?: Maybe<Entry>;
99+
/** A feed of repository submissions */
100+
feed?: Maybe<Array<Maybe<Entry>>>;
101+
};
102+
103+
export type QueryEntryArgs = {
104+
repoFullName: Scalars['String'];
105+
};
106+
107+
export type QueryFeedArgs = {
108+
limit?: InputMaybe<Scalars['Int']>;
109+
offset?: InputMaybe<Scalars['Int']>;
110+
type: FeedType;
111+
};
112+
113+
/**
114+
* A repository object from the GitHub API. This uses the exact field names returned by the
115+
* GitHub API for simplicity, even though the convention for GraphQL is usually to camel case.
116+
*/
117+
export type Repository = {
118+
__typename?: 'Repository';
119+
/** The description of the repository */
120+
description?: Maybe<Scalars['String']>;
121+
/** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
122+
full_name: Scalars['String'];
123+
/** The link to the repository on GitHub */
124+
html_url: Scalars['String'];
125+
/** Just the name of the repository, e.g. GitHunt-API */
126+
name: Scalars['String'];
127+
/** The number of open issues on this repository on GitHub */
128+
open_issues_count?: Maybe<Scalars['Int']>;
129+
/** The owner of this repository on GitHub, e.g. apollostack */
130+
owner?: Maybe<User>;
131+
/** The number of people who have starred this repository on GitHub */
132+
stargazers_count: Scalars['Int'];
133+
};
134+
135+
export type Subscription = {
136+
__typename?: 'Subscription';
137+
/** Subscription fires on every comment added */
138+
commentAdded?: Maybe<Comment>;
139+
};
140+
141+
export type SubscriptionCommentAddedArgs = {
142+
repoFullName: Scalars['String'];
143+
};
144+
145+
/** A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
146+
export type User = {
147+
__typename?: 'User';
148+
/** The URL to a directly embeddable image for this user's avatar */
149+
avatar_url: Scalars['String'];
150+
/** The URL of this user's GitHub page */
151+
html_url: Scalars['String'];
152+
/** The name of the user, e.g. apollostack */
153+
login: Scalars['String'];
154+
};
155+
156+
/** XXX to be removed */
157+
export type Vote = {
158+
__typename?: 'Vote';
159+
vote_value: Scalars['Int'];
160+
};
161+
25162
/** The type of vote to record, when submitting a vote */
26163
export enum VoteType {
27164
Cancel = 'CANCEL',

dev-test/star-wars/types.preResolveTypes.onlyOperationTypes.ts

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@ export type ColorInput = {
1919
red: Scalars['Int'];
2020
};
2121

22+
/** An autonomous mechanical character in the Star Wars universe */
23+
export type Droid = Character & {
24+
__typename?: 'Droid';
25+
/** The movies this droid appears in */
26+
appearsIn: Array<Maybe<Episode>>;
27+
/** This droid's friends, or an empty list if they have none */
28+
friends?: Maybe<Array<Maybe<Character>>>;
29+
/** The friends of the droid exposed as a connection with edges */
30+
friendsConnection: FriendsConnection;
31+
/** The ID of the droid */
32+
id: Scalars['ID'];
33+
/** What others call this droid */
34+
name: Scalars['String'];
35+
/** This droid's primary function */
36+
primaryFunction?: Maybe<Scalars['String']>;
37+
};
38+
39+
/** An autonomous mechanical character in the Star Wars universe */
40+
export type DroidFriendsConnectionArgs = {
41+
after?: InputMaybe<Scalars['ID']>;
42+
first?: InputMaybe<Scalars['Int']>;
43+
};
44+
2245
/** The episodes in the Star Wars trilogy */
2346
export enum Episode {
2447
/** Star Wars Episode V: The Empire Strikes Back, released in 1980. */
@@ -29,6 +52,62 @@ export enum Episode {
2952
Newhope = 'NEWHOPE',
3053
}
3154

55+
/** A connection object for a character's friends */
56+
export type FriendsConnection = {
57+
__typename?: 'FriendsConnection';
58+
/** The edges for each of the character's friends. */
59+
edges?: Maybe<Array<Maybe<FriendsEdge>>>;
60+
/** A list of the friends, as a convenience when edges are not needed. */
61+
friends?: Maybe<Array<Maybe<Character>>>;
62+
/** Information for paginating this connection */
63+
pageInfo: PageInfo;
64+
/** The total number of friends */
65+
totalCount?: Maybe<Scalars['Int']>;
66+
};
67+
68+
/** An edge object for a character's friends */
69+
export type FriendsEdge = {
70+
__typename?: 'FriendsEdge';
71+
/** A cursor used for pagination */
72+
cursor: Scalars['ID'];
73+
/** The character represented by this friendship edge */
74+
node?: Maybe<Character>;
75+
};
76+
77+
/** A humanoid creature from the Star Wars universe */
78+
export type Human = Character & {
79+
__typename?: 'Human';
80+
/** The movies this human appears in */
81+
appearsIn: Array<Maybe<Episode>>;
82+
/** This human's friends, or an empty list if they have none */
83+
friends?: Maybe<Array<Maybe<Character>>>;
84+
/** The friends of the human exposed as a connection with edges */
85+
friendsConnection: FriendsConnection;
86+
/** Height in the preferred unit, default is meters */
87+
height?: Maybe<Scalars['Float']>;
88+
/** The home planet of the human, or null if unknown */
89+
homePlanet?: Maybe<Scalars['String']>;
90+
/** The ID of the human */
91+
id: Scalars['ID'];
92+
/** Mass in kilograms, or null if unknown */
93+
mass?: Maybe<Scalars['Float']>;
94+
/** What this human calls themselves */
95+
name: Scalars['String'];
96+
/** A list of starships this person has piloted, or an empty list if none */
97+
starships?: Maybe<Array<Maybe<Starship>>>;
98+
};
99+
100+
/** A humanoid creature from the Star Wars universe */
101+
export type HumanFriendsConnectionArgs = {
102+
after?: InputMaybe<Scalars['ID']>;
103+
first?: InputMaybe<Scalars['Int']>;
104+
};
105+
106+
/** A humanoid creature from the Star Wars universe */
107+
export type HumanHeightArgs = {
108+
unit?: InputMaybe<LengthUnit>;
109+
};
110+
32111
/** Units of height */
33112
export enum LengthUnit {
34113
/** Primarily used in the United States */
@@ -37,6 +116,82 @@ export enum LengthUnit {
37116
Meter = 'METER',
38117
}
39118

119+
/** The mutation type, represents all updates we can make to our data */
120+
export type Mutation = {
121+
__typename?: 'Mutation';
122+
createReview?: Maybe<Review>;
123+
};
124+
125+
/** The mutation type, represents all updates we can make to our data */
126+
export type MutationCreateReviewArgs = {
127+
episode?: InputMaybe<Episode>;
128+
review: ReviewInput;
129+
};
130+
131+
/** Information for paginating this connection */
132+
export type PageInfo = {
133+
__typename?: 'PageInfo';
134+
endCursor?: Maybe<Scalars['ID']>;
135+
hasNextPage: Scalars['Boolean'];
136+
startCursor?: Maybe<Scalars['ID']>;
137+
};
138+
139+
/** The query type, represents all of the entry points into our object graph */
140+
export type Query = {
141+
__typename?: 'Query';
142+
character?: Maybe<Character>;
143+
droid?: Maybe<Droid>;
144+
hero?: Maybe<Character>;
145+
human?: Maybe<Human>;
146+
reviews?: Maybe<Array<Maybe<Review>>>;
147+
search?: Maybe<Array<Maybe<SearchResult>>>;
148+
starship?: Maybe<Starship>;
149+
};
150+
151+
/** The query type, represents all of the entry points into our object graph */
152+
export type QueryCharacterArgs = {
153+
id: Scalars['ID'];
154+
};
155+
156+
/** The query type, represents all of the entry points into our object graph */
157+
export type QueryDroidArgs = {
158+
id: Scalars['ID'];
159+
};
160+
161+
/** The query type, represents all of the entry points into our object graph */
162+
export type QueryHeroArgs = {
163+
episode?: InputMaybe<Episode>;
164+
};
165+
166+
/** The query type, represents all of the entry points into our object graph */
167+
export type QueryHumanArgs = {
168+
id: Scalars['ID'];
169+
};
170+
171+
/** The query type, represents all of the entry points into our object graph */
172+
export type QueryReviewsArgs = {
173+
episode: Episode;
174+
};
175+
176+
/** The query type, represents all of the entry points into our object graph */
177+
export type QuerySearchArgs = {
178+
text?: InputMaybe<Scalars['String']>;
179+
};
180+
181+
/** The query type, represents all of the entry points into our object graph */
182+
export type QueryStarshipArgs = {
183+
id: Scalars['ID'];
184+
};
185+
186+
/** Represents a review for a movie */
187+
export type Review = {
188+
__typename?: 'Review';
189+
/** Comment about the movie */
190+
commentary?: Maybe<Scalars['String']>;
191+
/** The number of stars this review gave, 1-5 */
192+
stars: Scalars['Int'];
193+
};
194+
40195
/** The input object sent when someone is creating a new review */
41196
export type ReviewInput = {
42197
/** Comment about the movie, optional */
@@ -47,6 +202,20 @@ export type ReviewInput = {
47202
stars: Scalars['Int'];
48203
};
49204

205+
export type Starship = {
206+
__typename?: 'Starship';
207+
/** The ID of the starship */
208+
id: Scalars['ID'];
209+
/** Length of the starship, along the longest axis */
210+
length?: Maybe<Scalars['Float']>;
211+
/** The name of the starship */
212+
name: Scalars['String'];
213+
};
214+
215+
export type StarshipLengthArgs = {
216+
unit?: InputMaybe<LengthUnit>;
217+
};
218+
50219
export type CreateReviewForEpisodeMutationVariables = Exact<{
51220
episode: Episode;
52221
review: ReviewInput;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export type TestQueryVariables = Exact<{ [key: string]: never }>;
2+
3+
export type TestQuery = {
4+
__typename?: 'Query';
5+
testArr1?: Array<string | null> | null;
6+
testArr2: Array<string | null>;
7+
testArr3: Array<string>;
8+
};

dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,31 @@ export type Scalars = {
1212
Float: number;
1313
};
1414

15+
export type Query = {
16+
__typename?: 'Query';
17+
allUsers: Array<Maybe<User>>;
18+
/**
19+
* Generates a new answer for th
20+
* guessing game
21+
*/
22+
answer: Array<Scalars['Int']>;
23+
testArr1?: Maybe<Array<Maybe<Scalars['String']>>>;
24+
testArr2: Array<Maybe<Scalars['String']>>;
25+
testArr3: Array<Scalars['String']>;
26+
userById?: Maybe<User>;
27+
};
28+
29+
export type QueryUserByIdArgs = {
30+
id: Scalars['Int'];
31+
};
32+
33+
export type User = {
34+
__typename?: 'User';
35+
email: Scalars['String'];
36+
id: Scalars['Int'];
37+
name: Scalars['String'];
38+
};
39+
1540
export type TestQueryVariables = Exact<{ [key: string]: never }>;
1641

1742
export type TestQuery = {

0 commit comments

Comments
 (0)