Skip to content

Commit 601a4d4

Browse files
committed
tests: add introspection query loading test
1 parent 8128768 commit 601a4d4

3 files changed

Lines changed: 1072 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"schemaPath": "./schema.json"
3+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import test from 'ava'
2+
import { join } from 'path'
3+
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

Comments
 (0)