Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated type when fields are named the same as operation types #1369

Merged
merged 3 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev-test/githunt/types.noNamespaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type Maybe<T> = T | null;

createdAt: number;

comments: CommentComments[];
comments: (Maybe<CommentComments>)[];

commentCount: number;

Expand Down Expand Up @@ -144,7 +144,7 @@ export type Maybe<T> = T | null;

currentUser: Maybe<FeedCurrentUser>;

feed: Maybe<FeedFeed[]>;
feed: Maybe<(Maybe<FeedFeed>)[]>;
};

export type FeedCurrentUser = {
Expand Down
9 changes: 5 additions & 4 deletions dev-test/githunt/types.reactApollo.noNamespaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export type Maybe<T> = T | null;

createdAt: number;

comments: CommentComments[];
comments: (Maybe<CommentComments>)[];

commentCount: number;

Expand Down Expand Up @@ -145,7 +145,7 @@ export type Maybe<T> = T | null;

currentUser: Maybe<FeedCurrentUser>;

feed: Maybe<FeedFeed[]>;
feed: Maybe<(Maybe<FeedFeed>)[]>;
}

export type FeedCurrentUser = {
Expand Down Expand Up @@ -300,10 +300,11 @@ export type Maybe<T> = T | null;
vote_value: number;
}


import gql from 'graphql-tag';
import * as React from 'react';
import * as ReactApollo from 'react-apollo';
import * as React from 'react';

import gql from 'graphql-tag';



Expand Down
5 changes: 3 additions & 2 deletions dev-test/githunt/types.reactApollo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ export namespace VoteButtons {
}
}


import gql from 'graphql-tag';
import * as React from 'react';
import * as ReactApollo from 'react-apollo';
import * as React from 'react';

import gql from 'graphql-tag';



Expand Down
7 changes: 4 additions & 3 deletions dev-test/test-message/types.reactApollo.noNamespaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface CreateMessageInput {
export type GetMessagesQuery = {
__typename?: "Query";

messages: Maybe<GetMessagesMessages[]>;
messages: Maybe<(Maybe<GetMessagesMessages>)[]>;
}

export type GetMessagesMessages = {
Expand Down Expand Up @@ -95,10 +95,11 @@ export interface CreateMessageInput {
id: string;
}


import gql from 'graphql-tag';
import * as React from 'react';
import * as ReactApollo from 'react-apollo';
import * as React from 'react';

import gql from 'graphql-tag';



Expand Down
68 changes: 11 additions & 57 deletions dev-test/test-message/types.stencilApollo.noNamespaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface CreateMessageInput {
export type GetMessagesQuery = {
__typename?: "Query";

messages: Maybe<GetMessagesMessages[]>;
messages: Maybe<(Maybe<GetMessagesMessages>)[]>;
}

export type GetMessagesMessages = {
Expand Down Expand Up @@ -95,7 +95,6 @@ export interface CreateMessageInput {
id: string;
}

import { FunctionalComponent } from '@stencil/core';

import gql from 'graphql-tag';

Expand All @@ -119,20 +118,11 @@ import gql from 'graphql-tag';


`;
export interface ComponentProps {
export interface GetMessagesComponentProps {
variables ?: GetMessagesVariables;
onReady ?: import('stencil-apollo/dist/types/components/apollo-query/types').OnQueryReadyFn<GetMessagesQuery, GetMessagesVariables>;
}
export const GetMessagesComponent: FunctionalComponent<ComponentProps> = (props, children) => {
return (
<apollo-query
query={ GetMessagesDocument }
{...props}
>
{children}
</apollo-query>
);
}
export const GetMessagesComponent = (props: GetMessagesComponentProps) => <apollo-query query={ GetMessagesDocument } {...props} />;
export const CreateMessageDocument = gql`
mutation CreateMessage($args: CreateMessageInput!) {
createMessage(args: $args) {
Expand All @@ -143,20 +133,11 @@ import gql from 'graphql-tag';


`;
export interface ComponentProps {
export interface CreateMessageComponentProps {
variables ?: CreateMessageVariables;
onReady ?: import('stencil-apollo/dist/types/components/apollo-mutation/types').OnMutationReadyFn<CreateMessageMutation, CreateMessageVariables>;
}
export const CreateMessageComponent: FunctionalComponent<ComponentProps> = (props, children) => {
return (
<apollo-mutation
mutation={ CreateMessageDocument }
{...props}
>
{children}
</apollo-mutation>
);
}
export const CreateMessageComponent = (props: CreateMessageComponentProps) => <apollo-mutation mutation={ CreateMessageDocument } {...props} />;
export const DeclineDocument = gql`
mutation Decline($id: ID!, $reason: String!) {
decline(id: $id, reason: $reason) {
Expand All @@ -167,20 +148,11 @@ import gql from 'graphql-tag';


`;
export interface ComponentProps {
export interface DeclineComponentProps {
variables ?: DeclineVariables;
onReady ?: import('stencil-apollo/dist/types/components/apollo-mutation/types').OnMutationReadyFn<DeclineMutation, DeclineVariables>;
}
export const DeclineComponent: FunctionalComponent<ComponentProps> = (props, children) => {
return (
<apollo-mutation
mutation={ DeclineDocument }
{...props}
>
{children}
</apollo-mutation>
);
}
export const DeclineComponent = (props: DeclineComponentProps) => <apollo-mutation mutation={ DeclineDocument } {...props} />;
export const ApproveDocument = gql`
mutation Approve($id: ID!) {
approve(id: $id) {
Expand All @@ -191,20 +163,11 @@ import gql from 'graphql-tag';


`;
export interface ComponentProps {
export interface ApproveComponentProps {
variables ?: ApproveVariables;
onReady ?: import('stencil-apollo/dist/types/components/apollo-mutation/types').OnMutationReadyFn<ApproveMutation, ApproveVariables>;
}
export const ApproveComponent: FunctionalComponent<ComponentProps> = (props, children) => {
return (
<apollo-mutation
mutation={ ApproveDocument }
{...props}
>
{children}
</apollo-mutation>
);
}
export const ApproveComponent = (props: ApproveComponentProps) => <apollo-mutation mutation={ ApproveDocument } {...props} />;
export const EscalateDocument = gql`
mutation Escalate($id: ID!) {
escalate(id: $id) {
Expand All @@ -215,17 +178,8 @@ import gql from 'graphql-tag';


`;
export interface ComponentProps {
export interface EscalateComponentProps {
variables ?: EscalateVariables;
onReady ?: import('stencil-apollo/dist/types/components/apollo-mutation/types').OnMutationReadyFn<EscalateMutation, EscalateVariables>;
}
export const EscalateComponent: FunctionalComponent<ComponentProps> = (props, children) => {
return (
<apollo-mutation
mutation={ EscalateDocument }
{...props}
>
{children}
</apollo-mutation>
);
}
export const EscalateComponent = (props: EscalateComponentProps) => <apollo-mutation mutation={ EscalateDocument } {...props} />;
Loading