Open donovanhiland opened 6 years ago
Huh... No idea why an endpointName
would magically appear here. You could try diving into your node_modules
to see if that helps...
Let us know what you come up with.
Ok so the magically appearing endpointName
isn't so magical after all. I have an env var GRAPHQL_CONFIG_ENDPOINT_NAME
which yargs is parsing and passing as an argument with something like .env('GRAPHQL_CONFIG')
. It's not expecting an endpointName
argument and so fails on yargs.strict()
.
In my package.json:
{
"scripts": {
"start": "nps",
"introspection": "graphql get-schema"
}
}
My package-scripts.js
{
scripts: {
introspection: 'graphql get-schema',
npmIntrospection: 'yarn run introspection'
}
}
yarn start introspection
- fails
yarn start npmIntrospection
- fails
yarn run introspection
- works
I'm curious as to why running it through nps in any fashion fails, but directly running the npm script works.
I have no idea why this is happening though:
I have an env var GRAPHQL_CONFIG_ENDPOINT_NAME which yargs is parsing and passing as an argument with something like .env('GRAPHQL_CONFIG')
and
I'm curious as to why running it through nps in any fashion fails, but directly running the npm script works.
I'm also curious. I'm really sorry @donovanhiland, I just have very limited time to dedicate to this package so I can't be a lot of help to you here :-/
I totally understand! I'll document any other findings here in case someone else runs into the same issue.
nps
version: 5.8.0node
version: 9.4.0npm
version: 5.6.0Scripts file (or at least the relevant bits):
The command executed:
The output:
Problem description:
When running
graphql get-schema
withnps
, anendpointName
options gets passed through which fails validation ingraphql-cli
. Running the same command frompackage.json
scripts works as expected. I'm not sure where the issue can be resolved from, if either, so I think I'm going to open an issue in both and see if something can be resolved. Happy to help how I can.