8000 Merge branch 'master' into feature/custom_codec · graphql-python/gql-next@2d0dd2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d0dd2e

Browse files
committed
Merge branch 'master' into feature/custom_codec
2 parents 09156f8 + 239b071 commit 2d0dd2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

gql/cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,20 @@ def cli():
3636 8000

3737
@cli.command()
3838
@click.option('--schema', prompt=SCHEMA_PROMPT, default='http://localhost:4000')
39+
@click.option('--endpoint', prompt=SCHEMA_PROMPT, default='same as schema')
3940
@click.option('--root', prompt=ROOT_PROMPT, default='./src')
40-
@click.option('-c', '--config', 'config_filename', default=DEFAULT_CONFIG_FNAME, type=click.Path(exists=True))
41-
def init(schema, root, config_filename):
41+
@click.option('-c', '--config', 'config_filename', default=DEFAULT_CONFIG_FNAME, type=click.Path(exists=False))
42+
def init(schema, endpoint, root, config_filename):
4243
if isfile(config_filename):
4344
click.confirm(f'{config_filename} already exists. Are you sure you want to continue?', abort=True)
4445

46+
if endpoint == 'same as schema':
47+
endpoint = schema
48+
4549
documents = join_paths(root, '**/*.graphql')
4650
config = Config(
4751
schema=schema,
48-
endpoint=schema,
52+
endpoint=endpoint,
4953
documents=documents
5054
)
5155

0 commit comments

Comments
 (0)
0