Skip to content

Commit c5eb2b4

Browse files
authored
Merge pull request #147 from dotansimha/fixes
Fixes
2 parents fc8677c + 40b91ba commit c5eb2b4

34 files changed

+1523
-341
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<a name="0.8.11"></a>
2+
## [0.8.11](https://github.com/dotansimha/graphql-codegen/compare/0.8.10...0.8.11) (2017-07-24)
3+
4+
* Export all available interfaces from the compiler package (Fixes [#144](https://github.com/dotansimha/graphql-code-generator/issues/144)
5+
* Fixed incorrect typings path (Fixes [#143](https://github.com/dotansimha/graphql-code-generator/issues/143))
6+
* Simplify fragment emitting for selection sets (Fixes [#139](https://github.com/dotansimha/graphql-code-generator/issues/139))
7+
* Change TypeScript optional to use `?` instead of `| null` ([#142](https://github.com/dotansimha/graphql-code-generator/pull/142))
8+
* Allow insecure HTTP requests (Fixes [#137](https://github.com/dotansimha/graphql-code-generator/issues/137))
9+
110
<a name="0.8.10"></a>
211
## [0.8.10](https://github.com/dotansimha/graphql-codegen/compare/0.8.9...0.8.10) (2017-07-24)
312

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { CommentsPageComment } from './commentspagecomment.fragment';
2+
export namespace Comment {
3+
export type Variables = {
4+
repoFullName: string;
5+
limit?: number;
6+
offset?: number;
7+
}
8+
9+
export type Query = {
10+
currentUser?: CurrentUser;
11+
entry?: Entry;
12+
}
13+
14+
export type CurrentUser = {
15+
login: string;
16+
html_url: string;
17+
}
18+
19+
export type Entry = {
20+
id: number;
21+
postedBy: PostedBy;
22+
createdAt: number;
23+
comments: Comments[];
24+
commentCount: number;
25+
repository: Repository;
26+
}
27+
28+
export type PostedBy = {
29+
login: string;
30+
html_url: string;
31+
}
32+
33+
export type Comments = CommentsPageComment.Fragment
34+
35+
export type Repository = {
36+
full_name: string;
37+
html_url: string;
38+
} & RepositoryInlineFragment
39+
40+
export type RepositoryInlineFragment = {
41+
description?: string;
42+
open_issues_count?: number;
43+
stargazers_count: number;
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { User } from './user.type';
2+
/* A comment about an entry, submitted by a user */
3+
export interface Comment {
4+
id: number; /* The SQL ID of this entry */
5+
postedBy: User; /* The GitHub user who posted the comment */
6+
createdAt: number; /* A timestamp of when the comment was posted */
7+
content: string; /* The text of the comment */
8+
repoName: string; /* The repository which this comment is about */
9+
}
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export namespace CommentsPageComment {
2+
export type Fragment = {
3+
id: number;
4+
postedBy: PostedBy;
5+
createdAt: number;
6+
content: string;
7+
}
8+
export type PostedBy = {
9+
login: string;
10+
html_url: string;
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export namespace CurrentUserForProfile {
2+
export type Variables = {
3+
}
4+
5+
export type Query = {
6+
currentUser?: CurrentUser;
7+
}
8+
9+
export type CurrentUser = {
10+
login: string;
11+
avatar_url: string;
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Repository } from './repository.type';
2+
import { User } from './user.type';
3+
import { Comment } from './comment.type';
4+
import { Vote } from './vote.type';
5+
/* Information about a GitHub repository submitted to GitHunt */
6+
export interface Entry {
7+
repository: Repository; /* Information about the repository from GitHub */
8+
postedBy: User; /* The GitHub user who submitted this entry */
9+
createdAt: number; /* A timestamp of when the entry was submitted */
10+
score: number; /* The score of this repository, upvotes - downvotes */
11+
hotScore: number; /* The hot score of this repository */
12+
comments: Comment[]; /* Comments posted about this repository */
13+
commentCount: number; /* The number of comments posted about this repository */
14+
id: number; /* The SQL ID of this entry */
15+
vote: Vote; /* XXX to be changed */
16+
}
17+
18+
export interface CommentsEntryArgs {
19+
limit?: number;
20+
offset?: number;
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { FeedType } from './feedtype.enum';
2+
import { FeedEntry } from './feedentry.fragment';
3+
export namespace Feed {
4+
export type Variables = {
5+
type: FeedType;
6+
offset?: number;
7+
limit?: number;
8+
}
9+
10+
export type Query = {
11+
currentUser?: CurrentUser;
12+
feed?: Feed[];
13+
}
14+
15+
export type CurrentUser = {
16+
login: string;
17+
}
18+
19+
export type Feed = FeedEntry.Fragment
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export namespace FeedEntry {
2+
export type Fragment = {
3+
id: number;
4+
commentCount: number;
5+
repository: Repository;
6+
} & VoteButtons.Fragment & RepoInfo.Fragment
7+
export type Repository = {
8+
full_name: string;
9+
html_url: string;
10+
owner?: Owner;
11+
}
12+
export type Owner = {
13+
avatar_url: string;
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* A list of options for the sort order of the feed */
2+
export type FeedType = "HOT" | "NEW" | "TOP";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Entry } from './entry.type';
2+
import { VoteType } from './votetype.enum';
3+
import { Comment } from './comment.type';
4+
5+
export interface Mutation {
6+
submitRepository?: Entry; /* Submit a new repository, returns the new submission */
7+
vote?: Entry; /* Vote on a repository submission, returns the submission that was voted on */
8+
submitComment?: Comment; /* Comment on a repository, returns the new comment */
9+
}
10+
11+
export interface SubmitRepositoryMutationArgs {
12+
repoFullName: string; /* The full repository name from GitHub, e.g. &quot;apollostack/GitHunt-API&quot; */
13+
}
14+
export interface VoteMutationArgs {
15+
repoFullName: string; /* The full repository name from GitHub, e.g. &quot;apollostack/GitHunt-API&quot; */
16+
type: VoteType; /* The type of vote - UP, DOWN, or CANCEL */
17+
}
18+
export interface SubmitCommentMutationArgs {
19+
repoFullName: string; /* The full repository name from GitHub, e.g. &quot;apollostack/GitHunt-API&quot; */
20+
commentContent: string; /* The text content for the new comment */
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export namespace OnCommentAdded {
2+
export type Variables = {
3+
repoFullName: string;
4+
}
5+
6+
export type Subscription = {
7+
commentAdded?: CommentAdded;
8+
}
9+
10+
export type CommentAdded = {
11+
id: number;
12+
postedBy: PostedBy;
13+
createdAt: number;
14+
content: string;
15+
}
16+
17+
export type PostedBy = {
18+
login: string;
19+
html_url: string;
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Entry } from './entry.type';
2+
import { FeedType } from './feedtype.enum';
3+
import { User } from './user.type';
4+
5+
export interface Query {
6+
feed?: Entry[]; /* A feed of repository submissions */
7+
entry?: Entry; /* A single entry */
8+
currentUser?: User; /* Return the currently logged in user, or null if nobody is logged in */
9+
}
10+
11+
export interface FeedQueryArgs {
12+
type: FeedType; /* The sort order for the feed */
13+
offset?: number; /* The number of items to skip, for pagination */
14+
limit?: number; /* The number of items to fetch starting from the offset, for pagination */
15+
}
16+
export interface EntryQueryArgs {
17+
repoFullName: string; /* The full repository name from GitHub, e.g. &quot;apollostack/GitHunt-API&quot; */
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export namespace RepoInfo {
2+
export type Fragment = {
3+
createdAt: number;
4+
repository: Repository;
5+
postedBy: PostedBy;
6+
}
7+
export type Repository = {
8+
description?: string;
9+
stargazers_count: number;
10+
open_issues_count?: number;
11+
}
12+
export type PostedBy = {
13+
html_url: string;
14+
login: string;
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { User } from './user.type';
2+
/* A repository object from the GitHub API. This uses the exact field names returned by the
3+
GitHub API for simplicity, even though the convention for GraphQL is usually to camel case. */
4+
export interface Repository {
5+
name: string; /* Just the name of the repository, e.g. GitHunt-API */
6+
full_name: string; /* The full name of the repository with the username, e.g. apollostack/GitHunt-API */
7+
description?: string; /* The description of the repository */
8+
html_url: string; /* The link to the repository on GitHub */
9+
stargazers_count: number; /* The number of people who have starred this repository on GitHub */
10+
open_issues_count?: number; /* The number of open issues on this repository on GitHub */
11+
owner?: User; /* The owner of this repository on GitHub, e.g. apollostack */
12+
}
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { CommentsPageComment } from './commentspagecomment.fragment';
2+
export namespace SubmitComment {
3+
export type Variables = {
4+
repoFullName: string;
5+
commentContent: string;
6+
}
7+
8+
export type Mutation = {
9+
submitComment?: SubmitComment;
10+
}
11+
12+
export type SubmitComment = CommentsPageComment.Fragment
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export namespace SubmitRepository {
2+
export type Variables = {
3+
repoFullName: string;
4+
}
5+
6+
export type Mutation = {
7+
submitRepository?: SubmitRepository;
8+
}
9+
10+
export type SubmitRepository = {
11+
createdAt: number;
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Comment } from './comment.type';
2+
3+
export interface Subscription {
4+
commentAdded?: Comment; /* Subscription fires on every comment added */
5+
}
6+
7+
export interface CommentAddedSubscriptionArgs {
8+
repoFullName: string;
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* A user object from the GitHub API. This uses the exact field names returned from the GitHub API. */
2+
export interface User {
3+
login: string; /* The name of the user, e.g. apollostack */
4+
avatar_url: string; /* The URL to a directly embeddable image for this user&#x27;s avatar */
5+
html_url: string; /* The URL of this user&#x27;s GitHub page */
6+
}
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { VoteType } from './votetype.enum';
2+
export namespace Vote {
3+
export type Variables = {
4+
repoFullName: string;
5+
type: VoteType;
6+
}
7+
8+
export type Mutation = {
9+
vote?: Vote;
10+
}
11+
12+
export type Vote = {
13+
score: number;
14+
id: number;
15+
vote: _Vote;
16+
}
17+
18+
export type _Vote = {
19+
vote_value: number;
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* XXX to be removed */
2+
export interface Vote {
3+
vote_value: number;
4+
}
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export namespace VoteButtons {
2+
export type Fragment = {
3+
score: number;
4+
vote: Vote;
5+
}
6+
export type Vote = {
7+
vote_value: number;
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* The type of vote to record, when submitting a vote */
2+
export type VoteType = "UP" | "DOWN" | "CANCEL";

0 commit comments

Comments
 (0)