-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Describe the bug
Not explicitly defining "method": "POST"
in tsconfig.json
causes npx ts-graphql-plugin validate --verbose
to fail. On top of that, it fails with a wrong error message so it took me a good half hour to figure out. It fails with the following error message:
error: No GraphQL schema. Confirm your ts-graphql-plugin's "schema" configuration at tsconfig.json's compilerOptions.plugins section.
To Reproduce
Use schema over http without explicitly specifying method, like:
"plugins": [
{
"name": "ts-graphql-plugin",
"schema": {
"http": {
"url": "http://xy.com/graphql", // whatever your graphql endpoint is
// "method": "POST" // do not specify it explicitly and it will fail
}
},
"tag": "gql"
}
]
Expected behavior
I've read in the documentation that one can omit "method": "POST"
from tsconfig.json
since that is the default. If that is not explicitly written in config, plugin silently fails, even with verbose flag. Either the documentation could be updated (willing to do a PR if needed) and error message could be updated, or it should be fixed in the package to fallback to POST
even if not explicitly defined.
PS: great plugin and keep it going, thanks for your work.