We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f5d24da + 601a4d4 commit 79daeb6Copy full SHA for 79daeb6
4 files changed
src/__tests__/introspection-query/.graphqlconfig
@@ -0,0 +1,3 @@
1
+{
2
+ "schemaPath": "./schema.json"
3
+}
src/__tests__/introspection-query/getSchema.ts
@@ -0,0 +1,33 @@
+import test from 'ava'
+import { join } from 'path'
+import { printSchema } from 'graphql'
4
+const schema = require('../schema.json')
5
+import { getGraphQLConfig, GraphQLConfig } from '../../'
6
+
7
+test('reads single schema', t => {
8
+ const config = getGraphQLConfig(__dirname)
9
10
+ const typeDefs = `\
11
+schema {
12
+ query: RootQueryType
13
14
15
+type Bar {
16
+ widgets: [Widget]
17
18
19
+type RootQueryType {
20
+ foo: String
21
+ bar: Bar
22
23
24
+type Widget {
25
+ count: Int
26
27
+`
28
29
+ t.is(
30
+ printSchema(config.getProjectConfig('testSchemaA').getSchema()),
31
+ typeDefs,
32
+ )
33
+})
0 commit comments