Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify migration from 3.x to 4.x #1471

Open
wtrocki opened this issue Sep 30, 2020 · 4 comments
Open

Simplify migration from 3.x to 4.x #1471

wtrocki opened this issue Sep 30, 2020 · 4 comments

Comments

@wtrocki
Copy link
Collaborator

wtrocki commented Sep 30, 2020

There is 7k public repos using graphql-cli.
Most of them use it to getSchema from remote sources.
New CLi have this capability but it requires config file that people are not familiar with.

We can address that issue by building compatible command from 3.x (or even bringing the original command with some updates) to let people update it.

@wtrocki
Copy link
Collaborator Author

wtrocki commented Sep 30, 2020

Commands of the old cli:

graphql create [directory] Bootstrap a new GraphQL project
graphql add-endpoint Add new endpoint to .graphqlconfig
graphql add-project Add new project to .graphqlconfig
graphql get-schema Download schema from endpoint
graphql schema-status Show source & timestamp of local schema
graphql ping Ping GraphQL endpoint
graphql query Run query/mutation
graphql diff Show a diff between two schemas
graphql playground Open interactive GraphQL Playground
graphql lint Check schema for linting errors
graphql prepare Bundle schemas and generate bindings
graphql codegen [--target] [--output] Generates apollo-codegen
code/annotations from your
.graphqlconfig

@ardatan
Copy link
Collaborator

ardatan commented Sep 30, 2020

A quick comparison;
create -> init
add-endpoint -> not sure if it's needed
add-project -> might be tricky
get-schema -> codegen with schema-ast can be used under the good
schema-status -> we don't have local or remote schemas, we only have one source of schema. So not sure about how this should work because there are different sources of schema other than file system
ping -> Maybe introspection query can be called but still there is no standard way to ping the schema(source might not be always URL).
query -> There is a tool from Hasura does this job on the command line. We can have a plugin uses that tool under the hood.
diff -> I think we have this command already using GraphQL Inspector
playground -> I think we have this command as serve with many options
lint -> @dotansimha was working on an eslint plugin for that
prepare -> This can be done with generic-sdk plugin of codegen. I don't think we need an extra command for this and also prepare sounds too general.
codegen -> GraphQL Codegen :)

@wtrocki
Copy link
Collaborator Author

wtrocki commented Sep 30, 2020

yep. Only get schema. I went thru all opensource usages of CLI and in 90% all uses get-schema in their package.json files.

@wtrocki
Copy link
Collaborator Author

wtrocki commented Sep 30, 2020

query - yep this one can be extra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants