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

Unify Type and Arg parsing #1

Open
rodrigopr opened this issue Feb 16, 2016 · 1 comment
Open

Unify Type and Arg parsing #1

rodrigopr opened this issue Feb 16, 2016 · 1 comment

Comments

@rodrigopr
Copy link

Great work in making the lib extensible.

I've been testing, converting our schema to use it, and found few points not yet covered,
I'm fixing most of them and hope to submit a PR soon.

The biggest problem right now is to parse field args.

At the moment each kind (Type/Interface/Mutation/Query) handle the field/arg parsing; The code is replicated and using different listeners (which may add some boilerplate to the extension creator).
Also, some have few nuances (like not passing the types, interfaces reference to the listener), making harder to keep extension generic.

I propose create a generic Field/Arg class (similar to type/interface/etc) with a unified onGenerateField and onGenerateArg.
I think it'll simplify the code and avoid this kind of problem.

What do you think? There is a use case for kind-specific field//arg parser?

Can submit a PR with those changes if you find it interesting.

@larsbs
Copy link
Owner

larsbs commented Feb 16, 2016

Mmm, I think you're right. When I was developing the library, I didn't found any use cases where I would need this. But, if you have found some and you think that this approach can solve your problem, then go ahead. Send the PR, I would be very glad to accept it.

The only thing, as usual, is to make sure that all the tests are passing.

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