Skip to content

"No GraphQL schema" error (GitHub API) #1046

Open
@fregante

Description

@fregante

Like #106, but for GitHub’s schema

Describe the bug

❯ npx ts-graphql-plugin typegen --verbose
Found 1 errors generating type files.

error: No GraphQL schema. Confirm your ts-graphql-plugin's "schema" configuration at tsconfig.json's compilerOptions.plugins section.
No type files to generate.

To Reproduce

{
	"extends": "@sindresorhus/tsconfig",
	"compilerOptions": {
		"target": "es2022",
		"module": "es2022",
		"moduleResolution": "Node",
		"noUncheckedIndexedAccess": false,
		"noPropertyAccessFromIndexSignature": false,
		"lib": [
			"DOM",
			"DOM.Iterable",
			"ES2022"
		],
		"plugins": [
			{
				"name": "ts-graphql-plugin",
				"schema": "https://docs.github.com/public/schema.docs.graphql",
				"typegen": {
					"addons": [
						"ts-graphql-plugin/addons/typed-query-document"
					]
				}
			}
		]
	},
	"include": [
		"source",
		"test",
		"build",
		"webpack.config.ts"
	]
}

Additional context

I'm able to download the schema from the browser, but the suggested curl command fails:

curl -X POST -H "Content-Type: application/json" -d '{"query":"\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n "}' https://docs.github.com/public/schema.docs.graphql

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body { font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Microsoft</title></head><body><div id='content'><div id='message'><h2>The request is blocked.</h2></div><div id='errorref'><span>06+J2ZAAAAAAnNfhTqbSpR5M7KXwz7WHBUEhMMzBFREdFMDMxOQA1OTZkNzhhMi1jYTVmLTQ3OWQtYmNkYy0wODM1ODMzMTc0YjI=</span></div></div></body></html>⏎

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions