From e3fdcf10a6ef5b6f09bdc07d2e7edcb6a2672324 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Mon, 29 Apr 2019 14:45:41 -0400 Subject: [PATCH] Inline the introspectionQuery and change includeDeprecated to false --- script/fetch-schema | 97 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 92 insertions(+), 5 deletions(-) diff --git a/script/fetch-schema b/script/fetch-schema index 4b695b09ec..54917c9670 100755 --- a/script/fetch-schema +++ b/script/fetch-schema @@ -3,13 +3,100 @@ const fs = require('fs'); const path = require('path'); const fetch = require('node-fetch'); -const { - buildClientSchema, - introspectionQuery, - printSchema, -} = require('graphql/utilities'); +const {buildClientSchema, printSchema} = require('graphql/utilities'); const schemaPath = path.resolve(__dirname, '..', 'graphql', 'schema'); +const introspectionQuery = ` + query IntrospectionQuery { + __schema { + queryType { name } + mutationType { name } + subscriptionType { name } + types { + ...FullType + } + directives { + name + description + locations + args { + ...InputValue + } + } + } + } + fragment FullType on __Type { + kind + name + description + fields(includeDeprecated: false) { + name + description + args { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: false) { + name + description + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + fragment InputValue on __InputValue { + name + description + type { ...TypeRef } + defaultValue + } + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } +`; + const token = process.env.GITHUB_TOKEN; if (!token) { throw new Error('You must specify a GitHub auth token in GITHUB_TOKEN');