1- // Jest Snapshot v1, https://jestjs.io/docs /snapshot-testing
1+ // Vitest Snapshot v1, https://vitest.dev/guide /snapshot.html
22
3- exports [` apollo-client sdk Should generate Sdk correctly 1` ] = `
3+ exports [` apollo-client > sdk > Should generate Sdk correctly 1` ] = `
44"export type Maybe<T > = T | null;
55export type InputMaybe<T > = Maybe<T >;
66export type Exact<T extends { [key : string ]: unknown } > = { [K in keyof T ]: T [K ] } ;
77export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K ]?: Maybe < T [SubKey ]> } ;
88export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K ]: Maybe < T [SubKey ]> } ;
9+ export type MakeEmpty<T extends { [key : string ]: unknown } , K extends keyof T > = { [_ in K ]?: never } ;
10+ export type Incremental<T > = T | { [P in keyof T ]?: P extends ' $fragmentName' | ' __typename' ? T [P ] : never } ;
911import { ApolloClient , QueryOptions , SubscriptionOptions , MutationOptions } from '@apollo/client';
1012import gql from 'graphql-tag';
1113/** All built-in and custom scalars, mapped to their actual values */
1214export type Scalars = {
13- ID : string ;
14- String : string ;
15- Boolean : boolean ;
16- Int : number ;
17- Float : number ;
15+ ID : { input: string ; output : string ; }
16+ String : { input: string ; output : string ; }
17+ Boolean : { input: boolean ; output : boolean ; }
18+ Int : { input: number ; output : number ; }
19+ Float : { input: number ; output : number ; }
1820} ;
1921
2022export type Query = {
@@ -30,13 +32,13 @@ export type Query = {
3032
3133export type QueryFeedArgs = {
3234 type : FeedType ;
33- offset ?: InputMaybe < Scalars [' Int' ]> ;
34- limit ?: InputMaybe < Scalars [' Int' ]> ;
35+ offset ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
36+ limit ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
3537} ;
3638
3739
3840export type QueryEntryArgs = {
39- repoFullName : Scalars [' String' ];
41+ repoFullName : Scalars [' String' ][ ' input ' ] ;
4042} ;
4143
4244/** A list of options for the sort order of the feed */
@@ -57,26 +59,26 @@ export type Entry = {
5759 /** The GitHub user who submitted this entry */
5860 postedBy : User ;
5961 /** A timestamp of when the entry was submitted */
60- createdAt : Scalars [' Float' ];
62+ createdAt : Scalars [' Float' ][ ' output ' ] ;
6163 /** The score of this repository, upvotes - downvotes */
62- score : Scalars [' Int' ];
64+ score : Scalars [' Int' ][ ' output ' ] ;
6365 /** The hot score of this repository */
64- hotScore : Scalars [' Float' ];
66+ hotScore : Scalars [' Float' ][ ' output ' ] ;
6567 /** Comments posted about this repository */
6668 comments : Array < Maybe <Comment >>;
6769 /** The number of comments posted about this repository */
68- commentCount: Scalars['Int'];
70+ commentCount: Scalars['Int']['output'] ;
6971 /** The SQL ID of this entry */
70- id: Scalars['Int'];
72+ id: Scalars['Int']['output'] ;
7173 /** XXX to be changed */
7274 vote: Vote;
7375};
7476
7577
7678/** Information about a GitHub repository submitted to GitHunt */
7779export type EntryCommentsArgs = {
78- limit ?: InputMaybe < Scalars [' Int' ]> ;
79- offset ?: InputMaybe < Scalars [' Int' ]> ;
80+ limit ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
81+ offset ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
8082} ;
8183
8284/**
@@ -86,17 +88,17 @@ export type EntryCommentsArgs = {
8688export type Repository = {
8789 __typename ?: ' Repository' ;
8890 /** Just the name of the repository, e.g. GitHunt-API */
89- name : Scalars [' String' ];
91+ name : Scalars [' String' ][ ' output ' ] ;
9092 /** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
91- full_name : Scalars [' String' ];
93+ full_name : Scalars [' String' ][ ' output ' ] ;
9294 /** The description of the repository */
93- description ?: Maybe < Scalars [' String' ]> ;
95+ description ?: Maybe < Scalars [' String' ][ ' output ' ] > ;
9496 /** The link to the repository on GitHub */
95- html_url : Scalars [' String' ];
97+ html_url : Scalars [' String' ][ ' output ' ] ;
9698 /** The number of people who have starred this repository on GitHub */
97- stargazers_count : Scalars [' Int' ];
99+ stargazers_count : Scalars [' Int' ][ ' output ' ] ;
98100 /** The number of open issues on this repository on GitHub */
99- open_issues_count ?: Maybe < Scalars [' Int' ]> ;
101+ open_issues_count ?: Maybe < Scalars [' Int' ][ ' output ' ] > ;
100102 /** The owner of this repository on GitHub, e.g. apollostack */
101103 owner ?: Maybe <User >;
102104};
@@ -105,32 +107,32 @@ export type Repository = {
105107export type User = {
106108 __typename ?: ' User' ;
107109 /** The name of the user, e.g. apollostack */
108- login : Scalars [' String' ];
110+ login : Scalars [' String' ][ ' output ' ] ;
109111 /** The URL to a directly embeddable image for this user's avatar */
110- avatar_url : Scalars [' String' ];
112+ avatar_url : Scalars [' String' ][ ' output ' ] ;
111113 /** The URL of this user's GitHub page */
112- html_url : Scalars [' String' ];
114+ html_url : Scalars [' String' ][ ' output ' ] ;
113115} ;
114116
115117/** A comment about an entry, submitted by a user */
116118export type Comment = {
117119 __typename ?: ' Comment' ;
118120 /** The SQL ID of this entry */
119- id : Scalars [' Int' ];
121+ id : Scalars [' Int' ][ ' output ' ] ;
120122 /** The GitHub user who posted the comment */
121123 postedBy : User ;
122124 /** A timestamp of when the comment was posted */
123- createdAt : Scalars [' Float' ];
125+ createdAt : Scalars [' Float' ][ ' output ' ] ;
124126 /** The text of the comment */
125- content : Scalars [' String' ];
127+ content : Scalars [' String' ][ ' output ' ] ;
126128 /** The repository which this comment is about */
127- repoName : Scalars [' String' ];
129+ repoName : Scalars [' String' ][ ' output ' ] ;
128130} ;
129131
130132/** XXX to be removed */
131133export type Vote = {
132134 __typename ?: ' Vote' ;
133- vote_value : Scalars [' Int' ];
135+ vote_value : Scalars [' Int' ][ ' output ' ] ;
134136} ;
135137
136138export type Mutation = {
@@ -145,19 +147,19 @@ export type Mutation = {
145147
146148
147149export type MutationSubmitRepositoryArgs = {
148- repoFullName : Scalars [' String' ];
150+ repoFullName : Scalars [' String' ][ ' input ' ] ;
149151} ;
150152
151153
152154export type MutationVoteArgs = {
153- repoFullName : Scalars [' String' ];
155+ repoFullName : Scalars [' String' ][ ' input ' ] ;
154156 type : VoteType ;
155157} ;
156158
157159
158160export type MutationSubmitCommentArgs = {
159- repoFullName : Scalars [' String' ];
160- commentContent : Scalars [' String' ];
161+ repoFullName : Scalars [' String' ][ ' input ' ] ;
162+ commentContent : Scalars [' String' ][ ' input ' ] ;
161163} ;
162164
163165/** The type of vote to record, when submitting a vote */
@@ -175,7 +177,7 @@ export type Subscription = {
175177
176178
177179export type SubscriptionCommentAddedArgs = {
178- repoFullName : Scalars [' String' ];
180+ repoFullName : Scalars [' String' ][ ' input ' ] ;
179181} ;
180182export type FeedQueryVariables = Exact<{ [key : string ]: never ; } >;
181183
@@ -306,21 +308,23 @@ async function test() {
306308} "
307309`;
308310
309- exports[`apollo-client sdk Should support useTypeImports 1`] = `
311+ exports[`apollo-client > sdk > Should support useTypeImports 1`] = `
310312"export type Maybe<T > = T | null;
311313export type InputMaybe<T > = Maybe<T >;
312314export type Exact<T extends { [key : string ]: unknown } > = { [K in keyof T ]: T [K ] } ;
313315export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K ]?: Maybe < T [SubKey ]> } ;
314316export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K ]: Maybe < T [SubKey ]> } ;
317+ export type MakeEmpty<T extends { [key : string ]: unknown } , K extends keyof T > = { [_ in K ]?: never } ;
318+ export type Incremental<T > = T | { [P in keyof T ]?: P extends ' $fragmentName' | ' __typename' ? T [P ] : never } ;
315319import type { ApolloClient , QueryOptions , SubscriptionOptions , MutationOptions } from '@apollo/client';
316320import gql from 'graphql-tag';
317321/** All built-in and custom scalars, mapped to their actual values */
318322export type Scalars = {
319- ID : string ;
320- String : string ;
321- Boolean : boolean ;
322- Int : number ;
323- Float : number ;
323+ ID : { input: string ; output : string ; }
324+ String : { input: string ; output : string ; }
325+ Boolean : { input: boolean ; output : boolean ; }
326+ Int : { input: number ; output : number ; }
327+ Float : { input: number ; output : number ; }
324328} ;
325329
326330export type Query = {
@@ -336,13 +340,13 @@ export type Query = {
336340
337341export type QueryFeedArgs = {
338342 type : FeedType ;
339- offset ?: InputMaybe < Scalars [' Int' ]> ;
340- limit ?: InputMaybe < Scalars [' Int' ]> ;
343+ offset ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
344+ limit ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
341345} ;
342346
343347
344348export type QueryEntryArgs = {
345- repoFullName : Scalars [' String' ];
349+ repoFullName : Scalars [' String' ][ ' input ' ] ;
346350} ;
347351
348352/** A list of options for the sort order of the feed */
@@ -363,26 +367,26 @@ export type Entry = {
363367 /** The GitHub user who submitted this entry */
364368 postedBy : User ;
365369 /** A timestamp of when the entry was submitted */
366- createdAt : Scalars [' Float' ];
370+ createdAt : Scalars [' Float' ][ ' output ' ] ;
367371 /** The score of this repository, upvotes - downvotes */
368- score : Scalars [' Int' ];
372+ score : Scalars [' Int' ][ ' output ' ] ;
369373 /** The hot score of this repository */
370- hotScore : Scalars [' Float' ];
374+ hotScore : Scalars [' Float' ][ ' output ' ] ;
371375 /** Comments posted about this repository */
372376 comments : Array < Maybe <Comment >>;
373377 /** The number of comments posted about this repository */
374- commentCount: Scalars['Int'];
378+ commentCount: Scalars['Int']['output'] ;
375379 /** The SQL ID of this entry */
376- id: Scalars['Int'];
380+ id: Scalars['Int']['output'] ;
377381 /** XXX to be changed */
378382 vote: Vote;
379383};
380384
381385
382386/** Information about a GitHub repository submitted to GitHunt */
383387export type EntryCommentsArgs = {
384- limit ?: InputMaybe < Scalars [' Int' ]> ;
385- offset ?: InputMaybe < Scalars [' Int' ]> ;
388+ limit ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
389+ offset ?: InputMaybe < Scalars [' Int' ][ ' input ' ] > ;
386390} ;
387391
388392/**
@@ -392,17 +396,17 @@ export type EntryCommentsArgs = {
392396export type Repository = {
393397 __typename ?: ' Repository' ;
394398 /** Just the name of the repository, e.g. GitHunt-API */
395- name : Scalars [' String' ];
399+ name : Scalars [' String' ][ ' output ' ] ;
396400 /** The full name of the repository with the username, e.g. apollostack/GitHunt-API */
397- full_name : Scalars [' String' ];
401+ full_name : Scalars [' String' ][ ' output ' ] ;
398402 /** The description of the repository */
399- description ?: Maybe < Scalars [' String' ]> ;
403+ description ?: Maybe < Scalars [' String' ][ ' output ' ] > ;
400404 /** The link to the repository on GitHub */
401- html_url : Scalars [' String' ];
405+ html_url : Scalars [' String' ][ ' output ' ] ;
402406 /** The number of people who have starred this repository on GitHub */
403- stargazers_count : Scalars [' Int' ];
407+ stargazers_count : Scalars [' Int' ][ ' output ' ] ;
404408 /** The number of open issues on this repository on GitHub */
405- open_issues_count ?: Maybe < Scalars [' Int' ]> ;
409+ open_issues_count ?: Maybe < Scalars [' Int' ][ ' output ' ] > ;
406410 /** The owner of this repository on GitHub, e.g. apollostack */
407411 owner ?: Maybe <User >;
408412};
@@ -411,32 +415,32 @@ export type Repository = {
411415export type User = {
412416 __typename ?: ' User' ;
413417 /** The name of the user, e.g. apollostack */
414- login : Scalars [' String' ];
418+ login : Scalars [' String' ][ ' output ' ] ;
415419 /** The URL to a directly embeddable image for this user's avatar */
416- avatar_url : Scalars [' String' ];
420+ avatar_url : Scalars [' String' ][ ' output ' ] ;
417421 /** The URL of this user's GitHub page */
418- html_url : Scalars [' String' ];
422+ html_url : Scalars [' String' ][ ' output ' ] ;
419423} ;
420424
421425/** A comment about an entry, submitted by a user */
422426export type Comment = {
423427 __typename ?: ' Comment' ;
424428 /** The SQL ID of this entry */
425- id : Scalars [' Int' ];
429+ id : Scalars [' Int' ][ ' output ' ] ;
426430 /** The GitHub user who posted the comment */
427431 postedBy : User ;
428432 /** A timestamp of when the comment was posted */
429- createdAt : Scalars [' Float' ];
433+ createdAt : Scalars [' Float' ][ ' output ' ] ;
430434 /** The text of the comment */
431- content : Scalars [' String' ];
435+ content : Scalars [' String' ][ ' output ' ] ;
432436 /** The repository which this comment is about */
433- repoName : Scalars [' String' ];
437+ repoName : Scalars [' String' ][ ' output ' ] ;
434438} ;
435439
436440/** XXX to be removed */
437441export type Vote = {
438442 __typename ?: ' Vote' ;
439- vote_value : Scalars [' Int' ];
443+ vote_value : Scalars [' Int' ][ ' output ' ] ;
440444} ;
441445
442446export type Mutation = {
@@ -451,19 +455,19 @@ export type Mutation = {
451455
452456
453457export type MutationSubmitRepositoryArgs = {
454- repoFullName : Scalars [' String' ];
458+ repoFullName : Scalars [' String' ][ ' input ' ] ;
455459} ;
456460
457461
458462export type MutationVoteArgs = {
459- repoFullName : Scalars [' String' ];
463+ repoFullName : Scalars [' String' ][ ' input ' ] ;
460464 type : VoteType ;
461465} ;
462466
463467
464468export type MutationSubmitCommentArgs = {
465- repoFullName : Scalars [' String' ];
466- commentContent : Scalars [' String' ];
469+ repoFullName : Scalars [' String' ][ ' input ' ] ;
470+ commentContent : Scalars [' String' ][ ' input ' ] ;
467471} ;
468472
469473/** The type of vote to record, when submitting a vote */
@@ -481,7 +485,7 @@ export type Subscription = {
481485
482486
483487export type SubscriptionCommentAddedArgs = {
484- repoFullName : Scalars [' String' ];
488+ repoFullName : Scalars [' String' ][ ' input ' ] ;
485489} ;
486490export type FeedQueryVariables = Exact<{ [key : string ]: never ; } >;
487491
0 commit comments