Skip to content

Commit 2a616db

Browse files
committed
Remove obsolete tests
1 parent 5609723 commit 2a616db

2 files changed

Lines changed: 30 additions & 437 deletions

File tree

packages/plugins/typescript/operations/tests/__snapshots__/ts-documents.spec.ts.snap

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,6 @@ export type VenueFragment =
8181
export type QQueryVariables = Exact<{ [key: string]: never; }>;
8282
8383
84-
export type QQuery = { hotel: { id: string, gpsPosition: { lat: number, lng: number } }, transport: { id: string } };
85-
"
86-
`;
87-
88-
exports[`TypeScript Operations Plugin > Issues > #3064 - fragments over interfaces causes issues with fields 2`] = `
89-
"type Venue_Hotel_Fragment = { id: string, gpsPosition: { lat: number, lng: number } };
90-
91-
type Venue_Transport_Fragment = { id: string };
92-
93-
export type VenueFragment =
94-
| Venue_Hotel_Fragment
95-
| Venue_Transport_Fragment
96-
;
97-
98-
export type QQueryVariables = Exact<{ [key: string]: never; }>;
99-
100-
10184
export type QQuery = { hotel: { id: string, gpsPosition: { lat: number, lng: number } }, transport: { id: string } };
10285
function test(q: QQuery) {
10386
if (q.hotel) {
@@ -130,17 +113,6 @@ export type AnimalFragmentFragment =
130113
"
131114
`;
132115

133-
exports[`TypeScript Operations Plugin > Issues > #8793 selecting __typename should not be optional 1`] = `
134-
"export type SnakeQueryQueryVariables = Exact<{ [key: string]: never; }>;
135-
136-
137-
export type SnakeQueryQuery = { __typename: 'Query', snake:
138-
| { __typename: 'Snake' }
139-
| { __typename: 'Error' }
140-
};
141-
"
142-
`;
143-
144116
exports[`TypeScript Operations Plugin > Selection Set > Should generate the correct __typename when using both inline fragment and spread over type 1`] = `
145117
"export type UserQueryQueryVariables = Exact<{ [key: string]: never; }>;
146118
@@ -182,21 +154,6 @@ export type AaaQuery = { user:
182154
"
183155
`;
184156

185-
exports[`TypeScript Operations Plugin > Selection Set > Should generate the correct intersection for fragments when using with interfaces with same type 2`] = `
186-
"export type Unnamed_1_QueryVariables = Exact<{ [key: string]: never; }>;
187-
188-
189-
export type Unnamed_1_Query = { b:
190-
| { id: string, x: number }
191-
| Record<PropertyKey, never>
192-
| null };
193-
194-
export type AFragment = { id: string };
195-
196-
export type BFragment = { x: number };
197-
"
198-
`;
199-
200157
exports[`TypeScript Operations Plugin > Selection Set > Should have valid __typename usage and split types according to that (with usage) 1`] = `
201158
"type NetRoute_Ipv4Route_Fragment = { __typename: 'IPV4Route', ipv4Address: any | null, ipv4Gateway: any | null };
202159
@@ -262,104 +219,3 @@ export type UserQueryQuery = { user:
262219
| null };
263220
"
264221
`;
265-
266-
exports[`TypeScript Operations Plugin > Union & Interfaces > #4216 - handle fragments against unions and interfaces with flattenGeneratedTypes 1`] = `
267-
"export type SearchPopularQueryVariables = Exact<{ [key: string]: never; }>;
268-
269-
270-
export type SearchPopularQuery = { search: Array<
271-
| { id: string | null }
272-
| { value: string, dimension: { id: string | null } | null }
273-
> | null };
274-
"
275-
`;
276-
277-
exports[`TypeScript Operations Plugin > Union & Interfaces > Should handle union selection sets with both FragmentSpreads and InlineFragments 1`] = `
278-
"export type UserQueryQueryVariables = Exact<{ [key: string]: never; }>;
279-
280-
281-
export type UserQueryQuery = { user:
282-
| { login: string, id: string }
283-
| { message: string }
284-
| { message: string, info: { message2: string, message: string } | null }
285-
};
286-
287-
export type AdditionalInfoFragment = { message: string };
288-
289-
type UserResult1_User_Fragment = { id: string };
290-
291-
type UserResult1_Error3_Fragment = { info: { message2: string } | null };
292-
293-
export type UserResult1Fragment =
294-
| UserResult1_User_Fragment
295-
| UserResult1_Error3_Fragment
296-
;
297-
298-
type UserResult_User_Fragment = { id: string };
299-
300-
type UserResult_Error2_Fragment = { message: string };
301-
302-
export type UserResultFragment =
303-
| UserResult_User_Fragment
304-
| UserResult_Error2_Fragment
305-
;
306-
"
307-
`;
308-
309-
exports[`TypeScript Operations Plugin > Union & Interfaces > Should handle union selection sets with both FragmentSpreads and InlineFragments with flattenGeneratedTypes 1`] = `
310-
"export type UserQueryQueryVariables = Exact<{ [key: string]: never; }>;
311-
312-
313-
export type UserQueryQuery = { user:
314-
| { id: string, login: string }
315-
| { message: string }
316-
| { message: string, info: { message2: string, message: string } | null }
317-
};
318-
319-
function t(q: UserQueryQuery) {
320-
if (q.user) {
321-
if (q.user.__typename === 'User') {
322-
if (q.user.id) {
323-
const u = q.user.login;
324-
}
325-
}
326-
if (q.user.__typename === 'Error2') {
327-
console.log(q.user.message);
328-
}
329-
if (q.user.__typename === 'Error3') {
330-
if (q.user.info) {
331-
console.log(q.user.info.__typename)
332-
}
333-
}
334-
}
335-
}"
336-
`;
337-
338-
exports[`TypeScript Operations Plugin > Union & Interfaces > Should handle union selection sets with both FragmentSpreads and InlineFragments with flattenGeneratedTypes and directives 1`] = `
339-
"export type UserQueryQueryVariables = Exact<{ [key: string]: never; }>;
340-
341-
342-
export type UserQueryQuery = { user:
343-
| { id: string, test2: string | null, login: string, test: string | null }
344-
| { message: string }
345-
| { message: string, info: { message2: string, message: string } | null }
346-
};
347-
348-
function t(q: UserQueryQuery) {
349-
if (q.user) {
350-
if (q.user.__typename === 'User') {
351-
if (q.user.id) {
352-
const u = q.user.login;
353-
}
354-
}
355-
if (q.user.__typename === 'Error2') {
356-
console.log(q.user.message);
357-
}
358-
if (q.user.__typename === 'Error3') {
359-
if (q.user.info) {
360-
console.log(q.user.info.__typename)
361-
}
362-
}
363-
}
364-
}"
365-
`;

0 commit comments

Comments
 (0)