-
Notifications
You must be signed in to change notification settings - Fork 42
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
Standalone type parsers #15
Comments
@wokalski What would be the case of such parsers for other case than scalars? Can you provide some use case? For me, it would be useful to be able to provide parsers for custom scalar types like |
@baransu to be honest I don't remember what was the use case I had when I experimented with it. The premise was to be able to take an existing
|
* fix: probably fix windows build * fix: build * Rename nodejs.yml to test.yml * Update and rename test.yml to main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update main.yml * Update CI * fix: esy build * fix: disable windows build * fix: reorder workflow * fix: typo * fix: try to fix * fix: try to figure out env variables * ci: another attempt * another ... * another ... * try release * fix: copy :P * fix: copy :P * ci: another fix * feat: try release * feat: remove travis ci * chore: remove traivis badge * ci: run release job only on release * ci: fix * ci: remove pull_request trigger * ci: pin menhir version for windows build * ci: pin menhir version for windows build * ci: make windows work * ci: fix setting env in windows * ci: windows .... * ci: remove old ci stuff * ci: install cross-env global for windows * fix: improve publish step * fix: try make windows work again pliz * fix: windows doesn't like comments :/ * fix: windows ci * fix: another one for windows :/ * ci: change name
It'd be useful to have standalone type parsers so that one can define such parser wherever they want to parse an object of a given GraphQL type. I took a very simple approach of generating a parser for a type name in #14 . It was promising however it yielded huge objects which took forever to compile.
Later I thought about using type names for simple types and inline fragments for objects. It's not ideal since we might want to generate a recursive parser however I think it's good enough for most use cases. Generating such parsers should not be too challenging. For simple types one could take the approach from #14 and for Objects it's possible to parse the fragment using
Document.inline_fragment
and then call directly tounify_selection_set
. The second case involves some internal refactorings but should be pretty straightforward.The text was updated successfully, but these errors were encountered: