timqian / gql-generator

Generate queries from graphql schema, used for writing api test.
MIT License
374 stars 93 forks source link

add programmatic access #59

Closed zvictor closed 2 years ago

zvictor commented 2 years ago

Programmatic access makes it easier to control processes in other libraries, such as here.


I don't know why github is showing such an aggressive diff for this PR. I just changed the indentation in most of the lines. I definitely didn't rewrite the whole thing 😅

That's what I have actually done (partial): image

zvictor commented 2 years ago

@timqian please let me know if there is any way to improve this PR.

As I mentioned, I don't know why the diff looks so bad in Github. You can check the file at https://github.com/zvictor/gql-generator/blob/master/index.js to confirm that I didn't change any of the logic other than wrap the main logic in a function (and pretty much nothing else).

I would like to push more PRs to this project still today, but I would like to wait for a confirmation on this one here first 😊

timqian commented 2 years ago

@zvictor Thanks for the PR.

As I mentioned, I don't know why the diff looks so bad in Github.

I guess we can not do much on this. When the indentation of a line changes, git thinks that line is changed