File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
- const graphql = require ( 'graphql' )
1
+ const { getIntrospectionQuery , buildClientSchema } = require ( 'graphql' )
2
2
const request = require ( "sync-request" )
3
3
4
4
const converter = require ( 'graphql-2-json-schema' ) ;
5
5
6
- module . exports = function ( graphUrl , authHeader ) {
7
-
6
+ module . exports = function ( graphUrl , authHeader ) {
8
7
const requestBody = {
9
8
operationName : "IntrospectionQuery" ,
10
- query : graphql . introspectionQuery
9
+ query : getIntrospectionQuery ( )
11
10
} ;
12
11
13
12
const headers = authHeader ? Object . fromEntries ( [ authHeader . split ( ":" ) ] ) : { } ;
@@ -17,10 +16,10 @@ module.exports = function (graphUrl, authHeader) {
17
16
json : requestBody
18
17
} ) . getBody ( 'utf8' ) ;
19
18
20
- const introspectionResponse = JSON . parse ( responseBody ) ;
19
+ const introspectionResponse = JSON . parse ( responseBody ) ;
21
20
21
+ const graphQLSchema = buildClientSchema ( introspectionResponse . data ) ;
22
22
const jsonSchema = converter . fromIntrospectionQuery ( introspectionResponse . data ) ;
23
- const graphQLSchema = graphql . buildClientSchema ( introspectionResponse . data , { assumeValid : true } ) ;
24
23
25
24
return {
26
25
jsonSchema,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " dociql" ,
3
- "version" : " 1.1.2 " ,
3
+ "version" : " 1.1.3 " ,
4
4
"description" : " Generate beautiful static API documentation from GraphQL Schema" ,
5
5
"preferGlobal" : true ,
6
6
"bin" : {
You can’t perform that action at this time.
0 commit comments