Closed rwinzhang closed 4 years ago
I ran into the same issue. The project can be specified like this:
{
"projects": {
"Project Name": {
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"dev": {
"url": "http://localhost:3000/graphql",
"headers": {
"Authorization": "Bearer ${env:AUTH_TOKEN_ENV}"
}
}
}
}
}
}
}
same problem here. get-schema should also work, when no project is specified, in particular, because in graphql init
it defaults to no project.
Also, if you add a project to your graphqlconfig, every other graphql
command will ask you to select a project (which is only one). That is very inconvenient
This is clearly a bug. all the commands should work even if no project is specified.
graphql init
graphql get-schema -e dev
This commands works for me, note if you put -e dev, in the end, it will work
Still the same, this is a bug and should be fixed. Does anybody know where the bug is in the code?
We've just released a new version and an alpha release channel for GraphQL CLI - 4.0.0-alpha.XXX
!
We've changed the get-schema
command to use GraphQL Code Generator plugin of GraphQL CLI with the Codegen's schema-ast
plugin.
We've also moved to use the new alpha
version of graphql-config
!
Could you check if that solves your current issue?
Checkout new instructions and the migration guide and we will be happy to hear your feedback during the alpha period!
Feel free to contact us by opening an issue or using our Discord channel; https://discord.gg/xud7bH
I've posted the wrong Discord link, this is the correct one: https://discord.gg/xud7bH9
my .graphqlconfig file
current workaround is running this command
API_TOKEN=abc graphql get-schema --project github
expected behavior the following command should run
API_TOKEN=abc graphql get-schema