Skip to content

Commit 65e667f

Browse files
committed
Set up test environment and create tests
1 parent 0cb2135 commit 65e667f

File tree

89 files changed

+17543
-1440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+17543
-1440
lines changed

.eslintrc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,12 @@ module.exports = {
6161
'import/prefer-default-export': 'off',
6262
},
6363
},
64+
{
65+
files: ['./tests/**/*.ts'],
66+
rules: {
67+
'@typescript-eslint/no-var-requires': 'off',
68+
'global-require': 'off',
69+
},
70+
},
6471
],
65-
};
72+
}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.idea/*
2-
.nyc_output
32
build
43
node_modules
54
test

dev-test/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SCHEMA_PATH = ./dev-test/test-schema/schema.graphql

dev-test/codegen.yml

Lines changed: 357 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,357 @@
1+
hooks:
2+
afterAllFileWrite:
3+
- prettier --write
4+
generates:
5+
./dev-test/test-schema/resolvers-types.ts:
6+
schema: ./dev-test/test-schema/schema-text.js
7+
plugins:
8+
- typescript
9+
- typescript-resolvers
10+
./dev-test/test-schema/flow-types.flow.js:
11+
schema: ./dev-test/test-schema/schema.json
12+
plugins:
13+
- flow
14+
- flow-resolvers
15+
./dev-test/test-schema/resolvers-root.ts:
16+
schema: ./dev-test/test-schema/schema-with-root.graphql
17+
plugins:
18+
- typescript
19+
- typescript-resolvers
20+
./dev-test/test-schema/resolvers-federation.ts:
21+
schema: ./dev-test/test-schema/schema-federation.graphql
22+
config:
23+
federation: true
24+
plugins:
25+
- typescript
26+
- typescript-resolvers
27+
./dev-test/test-schema/typings.ts:
28+
schema: ./dev-test/test-schema/schema.json
29+
plugins:
30+
- typescript
31+
- typescript-resolvers
32+
./dev-test/test-schema/typings.avoidOptionals.ts:
33+
schema: ./dev-test/test-schema/schema.json
34+
config:
35+
avoidOptionals: true
36+
plugins:
37+
- typescript
38+
./dev-test/test-schema/typings.wrapped.ts:
39+
schema: ./dev-test/test-schema/schema.json
40+
plugins:
41+
- add:
42+
content: 'declare namespace GraphQL {'
43+
- add:
44+
placement: append
45+
content: '}'
46+
- typescript
47+
- typescript-operations
48+
./dev-test/test-schema/env.types.ts:
49+
schema: ${SCHEMA_PATH}
50+
plugins:
51+
- typescript
52+
./dev-test/test-schema/typings.immutableTypes.ts:
53+
schema: ./dev-test/test-schema/schema.json
54+
config:
55+
imutableTypes: true
56+
plugins:
57+
- typescript
58+
./dev-test/test-schema/typings.enum.ts:
59+
schema: ./dev-test/test-schema/schema-object.js
60+
plugins:
61+
- typescript
62+
./dev-test/githunt/graphql-declared-modules.d.ts:
63+
schema: ./dev-test/githunt/schema.json
64+
documents: ./dev-test/githunt/**/*.graphql
65+
plugins:
66+
- typescript-graphql-files-modules
67+
./dev-test/githunt/typed-document-nodes.ts:
68+
schema: ./dev-test/githunt/schema.json
69+
documents: ./dev-test/githunt/**/*.graphql
70+
plugins:
71+
- typescript
72+
- typescript-operations
73+
- typed-document-node
74+
./dev-test/githunt/flow.flow.js:
75+
schema: ./dev-test/githunt/schema.json
76+
documents: ./dev-test/githunt/**/*.graphql
77+
plugins:
78+
- flow
79+
- flow-operations
80+
./dev-test/githunt/types.ts:
81+
schema: ./dev-test/githunt/schema.json
82+
documents: ./dev-test/githunt/**/*.graphql
83+
plugins:
84+
- typescript
85+
- typescript-operations
86+
./dev-test/githunt/types.preResolveTypes.ts:
87+
schema: ./dev-test/githunt/schema.json
88+
documents: ./dev-test/githunt/**/*.graphql
89+
config:
90+
preResolveTypes: true
91+
plugins:
92+
- typescript
93+
- typescript-operations
94+
./dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts:
95+
schema: ./dev-test/githunt/schema.json
96+
documents: ./dev-test/githunt/**/*.graphql
97+
config:
98+
preResolveTypes: true
99+
onlyOperationTypes: true
100+
plugins:
101+
- typescript
102+
- typescript-operations
103+
./dev-test/githunt/types.flatten.preResolveTypes.ts:
104+
schema: ./dev-test/githunt/schema.json
105+
documents: ./dev-test/githunt/**/*.graphql
106+
config:
107+
preResolveTypes: true
108+
flattenGeneratedTypes: true
109+
plugins:
110+
- typescript
111+
- typescript-operations
112+
./dev-test/githunt/types.preResolveTypes.compatibility.ts:
113+
schema: ./dev-test/githunt/schema.json
114+
documents: ./dev-test/githunt/**/*.graphql
115+
config:
116+
preResolveTypes: true
117+
plugins:
118+
- typescript
119+
- typescript-operations
120+
- typescript-compatibility
121+
./dev-test/githunt/types.enumsAsTypes.ts:
122+
schema: ./dev-test/githunt/schema.json
123+
documents: ./dev-test/githunt/**/*.graphql
124+
config:
125+
enumsAsTypes: true
126+
plugins:
127+
- typescript
128+
- typescript-operations
129+
./dev-test/githunt/types.d.ts:
130+
schema: ./dev-test/githunt/schema.json
131+
documents: ./dev-test/githunt/**/*.graphql
132+
config:
133+
enumsAsTypes: true
134+
plugins:
135+
- typescript
136+
- typescript-operations
137+
./dev-test/githunt/types.avoidOptionals.ts:
138+
schema: ./dev-test/githunt/schema.json
139+
documents: ./dev-test/githunt/**/*.graphql
140+
config:
141+
avoidOptionals: true
142+
plugins:
143+
- typescript
144+
- typescript-operations
145+
./dev-test/githunt/types.immutableTypes.ts:
146+
schema: ./dev-test/githunt/schema.json
147+
documents: ./dev-test/githunt/**/*.graphql
148+
config:
149+
immutableTypes: true
150+
plugins:
151+
- typescript
152+
- typescript-operations
153+
./dev-test/githunt/types.reactApollo.tsx:
154+
schema: ./dev-test/githunt/schema.json
155+
documents: ./dev-test/githunt/**/*.graphql
156+
plugins:
157+
- typescript
158+
- typescript-operations
159+
- typescript-react-apollo
160+
./dev-test/githunt/types.reactApollo.v2.tsx:
161+
schema: ./dev-test/githunt/schema.json
162+
documents: ./dev-test/githunt/**/*.graphql
163+
config:
164+
reactApolloVersion: 2
165+
plugins:
166+
- typescript
167+
- typescript-operations
168+
- typescript-react-apollo
169+
./dev-test/githunt/types.reactApollo.customSuffix.tsx:
170+
schema: ./dev-test/githunt/schema.json
171+
documents: ./dev-test/githunt/**/*.graphql
172+
config:
173+
operationResultSuffix: MyOperation
174+
plugins:
175+
- typescript
176+
- typescript-operations
177+
- typescript-react-apollo
178+
./dev-test/githunt/types.reactApollo.preResolveTypes.tsx:
179+
schema: ./dev-test/githunt/schema.json
180+
documents: ./dev-test/githunt/**/*.graphql
181+
config:
182+
preResolveTypes: true
183+
plugins:
184+
- typescript
185+
- typescript-operations
186+
- typescript-react-apollo
187+
./dev-test/githunt/types.reactApollo.hooks.tsx:
188+
schema: ./dev-test/githunt/schema.json
189+
documents: ./dev-test/githunt/**/*.graphql
190+
plugins:
191+
- typescript
192+
- typescript-operations
193+
- typescript-react-apollo
194+
./dev-test/githunt/types.apolloAngular.ts:
195+
schema: ./dev-test/githunt/schema.json
196+
documents: ./dev-test/githunt/**/*.graphql
197+
plugins:
198+
- typescript
199+
- typescript-operations
200+
- typescript-apollo-angular
201+
./dev-test/githunt/types.apolloAngular.sdk.ts:
202+
schema: ./dev-test/githunt/schema.json
203+
documents: ./dev-test/githunt/**/*.graphql
204+
config:
205+
sdkClass: true
206+
plugins:
207+
- typescript
208+
- typescript-operations
209+
- typescript-apollo-angular
210+
./dev-test/githunt/types.stencilApollo.tsx:
211+
schema: ./dev-test/githunt/schema.json
212+
documents: ./dev-test/githunt/**/*.graphql
213+
plugins:
214+
- typescript
215+
- typescript-operations
216+
- typescript-stencil-apollo
217+
./dev-test/githunt/types.urql.tsx:
218+
schema: ./dev-test/githunt/schema.json
219+
documents: ./dev-test/githunt/**/*.graphql
220+
plugins:
221+
- typescript
222+
- typescript-operations
223+
- typescript-urql
224+
./dev-test/githunt:
225+
schema: ./dev-test/githunt/schema.json
226+
documents: ./dev-test/githunt/**/*.graphql
227+
preset: near-operation-file
228+
presetConfig:
229+
extension: .stencil-component.tsx
230+
folder: __generated__
231+
baseTypesPath: types.d.ts
232+
plugins:
233+
- typescript-operations
234+
- typescript-stencil-apollo
235+
config:
236+
componentType: class
237+
globalNamespace: true
238+
./dev-test/githunt/types.vueApollo.ts:
239+
schema: ./dev-test/githunt/schema.json
240+
documents: ./dev-test/githunt/**/*.graphql
241+
plugins:
242+
- typescript
243+
- typescript-operations
244+
- typescript-vue-apollo
245+
./dev-test/star-wars/types.ts:
246+
schema: ./dev-test/star-wars/schema.json
247+
documents: ./dev-test/star-wars/**/*.graphql
248+
plugins:
249+
- typescript
250+
- typescript-operations
251+
./dev-test/star-wars/types.preResolveTypes.ts:
252+
schema: ./dev-test/star-wars/schema.json
253+
documents: ./dev-test/star-wars/**/*.graphql
254+
config:
255+
preResolveTypes: true
256+
plugins:
257+
- typescript
258+
- typescript-operations
259+
./dev-test/star-wars/types.preResolveTypes.onlyOperationTypes.ts:
260+
schema: ./dev-test/star-wars/schema.json
261+
documents: ./dev-test/star-wars/**/*.graphql
262+
config:
263+
preResolveTypes: true
264+
onlyOperationTypes: true
265+
plugins:
266+
- typescript
267+
- typescript-operations
268+
./dev-test/test-schema/types.preResolveTypes.ts:
269+
schema: ./dev-test/test-schema/schema.graphql
270+
documents:
271+
- 'query test { testArr1 testArr2 testArr3 }'
272+
config:
273+
preResolveTypes: true
274+
plugins:
275+
- typescript
276+
- typescript-operations
277+
./dev-test/test-schema/types.preResolveTypes.onlyOperationTypes.ts:
278+
schema: ./dev-test/test-schema/schema.graphql
279+
documents:
280+
- 'query test { testArr1 testArr2 testArr3 }'
281+
config:
282+
preResolveTypes: true
283+
onlyOperationTypes: true
284+
plugins:
285+
- typescript
286+
- typescript-operations
287+
./dev-test/star-wars/types.d.ts:
288+
schema: ./dev-test/star-wars/schema.json
289+
config:
290+
enumsAsTypes: true
291+
plugins:
292+
- typescript
293+
- typescript-operations
294+
./dev-test/star-wars:
295+
schema: ./dev-test/star-wars/schema.json
296+
documents: ./dev-test/star-wars/**/*.graphql
297+
preset: near-operation-file
298+
presetConfig:
299+
extension: .tsx
300+
folder: __generated__
301+
baseTypesPath: types.d.ts
302+
plugins:
303+
- typescript-operations
304+
- typescript-react-apollo
305+
./dev-test/star-wars/types.globallyAvailable.d.ts:
306+
schema: ./dev-test/star-wars/schema.json
307+
documents: ./dev-test/star-wars/**/*.graphql
308+
config:
309+
enumsAsTypes: true
310+
noExport: true
311+
plugins:
312+
- typescript
313+
- typescript-operations
314+
./dev-test/star-wars/types.avoidOptionals.ts:
315+
schema: ./dev-test/star-wars/schema.json
316+
documents: ./dev-test/star-wars/**/*.graphql
317+
config:
318+
avoidOptionals: true
319+
plugins:
320+
- typescript
321+
- typescript-operations
322+
./dev-test/star-wars/types.immutableTypes.ts:
323+
schema: ./dev-test/star-wars/schema.json
324+
documents: ./dev-test/star-wars/**/*.graphql
325+
config:
326+
immutableTypes: true
327+
plugins:
328+
- typescript
329+
- typescript-operations
330+
./dev-test/star-wars/types.skipSchema.ts:
331+
schema: ./dev-test/star-wars/schema.json
332+
documents: ./dev-test/star-wars/**/*.graphql
333+
plugins:
334+
- typescript
335+
- typescript-operations
336+
./dev-test/star-wars/types.refetchFn.tsx:
337+
schema: ./dev-test/star-wars/schema.json
338+
documents: ./dev-test/star-wars/**/*.graphql
339+
plugins:
340+
- typescript
341+
- typescript-react-apollo
342+
config:
343+
withRefetchFn: true
344+
./dev-test/test-message/types.tsx:
345+
schema: ./dev-test/test-message/schema.graphql
346+
documents: ./dev-test/test-message/documents.ts
347+
plugins:
348+
- typescript
349+
- typescript-operations
350+
- typescript-react-apollo
351+
config:
352+
documentMode: external
353+
importDocumentNodeExternallyFrom: './documents.ts'
354+
reactApolloVersion: 3
355+
gqlImport: graphql-tag
356+
hooksImportFrom: '@apollo/react-hooks'
357+
withMutationFn: false

0 commit comments

Comments
 (0)